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
9f4712af
Kaydet (Commit)
9f4712af
authored
Agu 03, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #23710: Merge from 3.5
üst
0d60c56e
bed6891c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
newtypes.rst
Doc/extending/newtypes.rst
+9
-5
No files found.
Doc/extending/newtypes.rst
Dosyayı görüntüle @
9f4712af
...
...
@@ -52,11 +52,15 @@ The first bit that will be new is::
} noddy_NoddyObject;
This is what a Noddy object will contain---in this case, nothing more than what
every Python object contains---a refcount and a pointer to a type object.
These are the fields the ``PyObject_HEAD`` macro brings in. The reason for the
macro is to standardize the layout and to enable special debugging fields in
debug builds. Note that there is no semicolon after the ``PyObject_HEAD``
macro; one is included in the macro definition. Be wary of adding one by
every Python object contains---a field called ``ob_base`` of type
:c:type:`PyObject`. :c:type:`PyObject` in turn, contains an ``ob_refcnt``
field and a pointer to a type object. These can be accessed using the macros
:c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE` respectively. These are the fields
the :c:macro:`PyObject_HEAD` macro brings in. The reason for the macro is to
standardize the layout and to enable special debugging fields in debug builds.
Note that there is no semicolon after the :c:macro:`PyObject_HEAD` macro;
one is included in the macro definition. Be wary of adding one by
accident; it's easy to do from habit, and your compiler might not complain,
but someone else's probably will! (On Windows, MSVC is known to call this an
error and refuse to compile the code.)
...
...
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