Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7cb3051d
Kaydet (Commit)
7cb3051d
authored
Ara 17, 2010
tarafından
Daniel Stutzbach
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 8753: Added documentation for Py_ReprEntr and Py_ReprLeave.
üst
94f58c3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
exceptions.rst
Doc/c-api/exceptions.rst
+29
-0
No files found.
Doc/c-api/exceptions.rst
Dosyayı görüntüle @
7cb3051d
...
...
@@ -533,6 +533,35 @@ recursion depth automatically).
Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each
*successful* invocation of :c:func:`Py_EnterRecursiveCall`.
Properly implementing :attr:`tp_repr` for container types requires
special recursion handling. In addition to protecting the stack,
:attr:`tp_repr` also needs to track objects to prevent cycles. The
following two functions facilitate this functionality. Effectively,
these are the C equivalent to :func:`reprlib.recursive_repr`.
.. c:function:: int Py_ReprEntr(PyObject *object)
Called at the beginning of the :attr:`tp_repr` implementation to
detect cycles.
If the object has already been processed, the function returns a
positive integer. In that case the :attr:`tp_repr` implementation
should return a string object indicating a cycle. As examples,
:class:`dict` objects return ``{...}`` and :class:`list` objects
return ``[...]``.
The function will return a negative integer if the recursion limit
is reached. In that case the :attr:`tp_repr` implementation should
typically return ``NULL``.
Otherwise, the function returns zero and the :attr:`tp_repr`
implementation can continue normally.
.. c:function:: void Py_ReprLeave(PyObject *object)
Ends a :c:func:`Py_ReprEntr`. Must be called once for each
invocation of :c:func:`Py_ReprEntr` that returns zero.
.. _standardexceptions:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment