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
36f22a28
Kaydet (Commit)
36f22a28
authored
Agu 25, 2015
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #24808: Merge 3.4 into 3.5; adjust new tp_as_async field
üst
ef4554f7
78d50333
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
16 deletions
+19
-16
typeobj.rst
Doc/c-api/typeobj.rst
+5
-5
newtypes.rst
Doc/extending/newtypes.rst
+3
-3
typestruct.h
Doc/includes/typestruct.h
+7
-8
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Doc/c-api/typeobj.rst
Dosyayı görüntüle @
36f22a28
...
@@ -94,7 +94,7 @@ type objects) *must* have the :attr:`ob_size` field.
...
@@ -94,7 +94,7 @@ type objects) *must* have the :attr:`ob_size` field.
This field is not inherited by subtypes.
This field is not inherited by subtypes.
.. c:member:: char* PyTypeObject.tp_name
.. c:member:: c
onst c
har* PyTypeObject.tp_name
Pointer to a NUL-terminated string containing the name of the type. For types
Pointer to a NUL-terminated string containing the name of the type. For types
that are accessible as module globals, the string should be the full module
that are accessible as module globals, the string should be the full module
...
@@ -372,7 +372,7 @@ type objects) *must* have the :attr:`ob_size` field.
...
@@ -372,7 +372,7 @@ type objects) *must* have the :attr:`ob_size` field.
inherited individually.
inherited individually.
.. c:member:: long PyTypeObject.tp_flags
.. c:member::
unsigned
long PyTypeObject.tp_flags
This field is a bit mask of various flags. Some flags indicate variant
This field is a bit mask of various flags. Some flags indicate variant
semantics for certain situations; others are used to indicate that certain
semantics for certain situations; others are used to indicate that certain
...
@@ -472,7 +472,7 @@ type objects) *must* have the :attr:`ob_size` field.
...
@@ -472,7 +472,7 @@ type objects) *must* have the :attr:`ob_size` field.
.. versionadded:: 3.4
.. versionadded:: 3.4
.. c:member:: char* PyTypeObject.tp_doc
.. c:member:: c
onst c
har* PyTypeObject.tp_doc
An optional pointer to a NUL-terminated C string giving the docstring for this
An optional pointer to a NUL-terminated C string giving the docstring for this
type object. This is exposed as the :attr:`__doc__` attribute on the type and
type object. This is exposed as the :attr:`__doc__` attribute on the type and
...
@@ -619,7 +619,7 @@ type objects) *must* have the :attr:`ob_size` field.
...
@@ -619,7 +619,7 @@ type objects) *must* have the :attr:`ob_size` field.
+----------------+------------+
+----------------+------------+
.. c:member::
long
PyTypeObject.tp_weaklistoffset
.. c:member::
Py_ssize_t
PyTypeObject.tp_weaklistoffset
If the instances of this type are weakly referenceable, this field is greater
If the instances of this type are weakly referenceable, this field is greater
than zero and contains the offset in the instance structure of the weak
than zero and contains the offset in the instance structure of the weak
...
@@ -786,7 +786,7 @@ type objects) *must* have the :attr:`ob_size` field.
...
@@ -786,7 +786,7 @@ type objects) *must* have the :attr:`ob_size` field.
.. XXX explain.
.. XXX explain.
.. c:member::
long
PyTypeObject.tp_dictoffset
.. c:member::
Py_ssize_t
PyTypeObject.tp_dictoffset
If the instances of this type have a dictionary containing instance variables,
If the instances of this type have a dictionary containing instance variables,
this field is non-zero and contains the offset in the instances of the type of
this field is non-zero and contains the offset in the instances of the type of
...
...
Doc/extending/newtypes.rst
Dosyayı görüntüle @
36f22a28
...
@@ -893,20 +893,20 @@ fields in the right order! It's often easiest to find an example that includes
...
@@ -893,20 +893,20 @@ fields in the right order! It's often easiest to find an example that includes
all the fields you need (even if they're initialized to ``0``) and then change
all the fields you need (even if they're initialized to ``0``) and then change
the values to suit your new type. ::
the values to suit your new type. ::
char *tp_name; /* For printing */
c
onst c
har *tp_name; /* For printing */
The name of the type - as mentioned in the last section, this will appear in
The name of the type - as mentioned in the last section, this will appear in
various places, almost entirely for diagnostic purposes. Try to choose something
various places, almost entirely for diagnostic purposes. Try to choose something
that will be helpful in such a situation! ::
that will be helpful in such a situation! ::
in
t tp_basicsize, tp_itemsize; /* For allocation */
Py_ssize_
t tp_basicsize, tp_itemsize; /* For allocation */
These fields tell the runtime how much memory to allocate when new objects of
These fields tell the runtime how much memory to allocate when new objects of
this type are created. Python has some built-in support for variable length
this type are created. Python has some built-in support for variable length
structures (think: strings, lists) which is where the :c:member:`~PyTypeObject.tp_itemsize` field
structures (think: strings, lists) which is where the :c:member:`~PyTypeObject.tp_itemsize` field
comes in. This will be dealt with later. ::
comes in. This will be dealt with later. ::
char *tp_doc;
c
onst c
har *tp_doc;
Here you can put a string (or its address) that you want returned when the
Here you can put a string (or its address) that you want returned when the
Python script references ``obj.__doc__`` to retrieve the doc string.
Python script references ``obj.__doc__`` to retrieve the doc string.
...
...
Doc/includes/typestruct.h
Dosyayı görüntüle @
36f22a28
typedef
struct
_typeobject
{
typedef
struct
_typeobject
{
PyObject_VAR_HEAD
PyObject_VAR_HEAD
char
*
tp_name
;
/* For printing, in format "<module>.<name>" */
c
onst
c
har
*
tp_name
;
/* For printing, in format "<module>.<name>" */
in
t
tp_basicsize
,
tp_itemsize
;
/* For allocation */
Py_ssize_
t
tp_basicsize
,
tp_itemsize
;
/* For allocation */
/* Methods to implement standard operations */
/* Methods to implement standard operations */
...
@@ -9,7 +9,7 @@ typedef struct _typeobject {
...
@@ -9,7 +9,7 @@ typedef struct _typeobject {
printfunc
tp_print
;
printfunc
tp_print
;
getattrfunc
tp_getattr
;
getattrfunc
tp_getattr
;
setattrfunc
tp_setattr
;
setattrfunc
tp_setattr
;
PyAsyncMethods
*
tp_as_async
;
PyAsyncMethods
*
tp_as_async
;
/* formerly known as tp_compare or tp_reserved */
reprfunc
tp_repr
;
reprfunc
tp_repr
;
/* Method suites for standard classes */
/* Method suites for standard classes */
...
@@ -30,9 +30,9 @@ typedef struct _typeobject {
...
@@ -30,9 +30,9 @@ typedef struct _typeobject {
PyBufferProcs
*
tp_as_buffer
;
PyBufferProcs
*
tp_as_buffer
;
/* Flags to define presence of optional/expanded features */
/* Flags to define presence of optional/expanded features */
long
tp_flags
;
unsigned
long
tp_flags
;
char
*
tp_doc
;
/* Documentation string */
c
onst
c
har
*
tp_doc
;
/* Documentation string */
/* call function for all accessible objects */
/* call function for all accessible objects */
traverseproc
tp_traverse
;
traverseproc
tp_traverse
;
...
@@ -44,7 +44,7 @@ typedef struct _typeobject {
...
@@ -44,7 +44,7 @@ typedef struct _typeobject {
richcmpfunc
tp_richcompare
;
richcmpfunc
tp_richcompare
;
/* weak reference enabler */
/* weak reference enabler */
long
tp_weaklistoffset
;
Py_ssize_t
tp_weaklistoffset
;
/* Iterators */
/* Iterators */
getiterfunc
tp_iter
;
getiterfunc
tp_iter
;
...
@@ -58,7 +58,7 @@ typedef struct _typeobject {
...
@@ -58,7 +58,7 @@ typedef struct _typeobject {
PyObject
*
tp_dict
;
PyObject
*
tp_dict
;
descrgetfunc
tp_descr_get
;
descrgetfunc
tp_descr_get
;
descrsetfunc
tp_descr_set
;
descrsetfunc
tp_descr_set
;
long
tp_dictoffset
;
Py_ssize_t
tp_dictoffset
;
initproc
tp_init
;
initproc
tp_init
;
allocfunc
tp_alloc
;
allocfunc
tp_alloc
;
newfunc
tp_new
;
newfunc
tp_new
;
...
@@ -69,7 +69,6 @@ typedef struct _typeobject {
...
@@ -69,7 +69,6 @@ typedef struct _typeobject {
PyObject
*
tp_cache
;
PyObject
*
tp_cache
;
PyObject
*
tp_subclasses
;
PyObject
*
tp_subclasses
;
PyObject
*
tp_weaklist
;
PyObject
*
tp_weaklist
;
destructor
tp_del
;
destructor
tp_del
;
/* Type attribute cache version tag. Added in version 2.6 */
/* Type attribute cache version tag. Added in version 2.6 */
...
...
Misc/ACKS
Dosyayı görüntüle @
36f22a28
...
@@ -1519,6 +1519,7 @@ Bob Weiner
...
@@ -1519,6 +1519,7 @@ Bob Weiner
Edward Welbourne
Edward Welbourne
Cliff Wells
Cliff Wells
Rickard Westman
Rickard Westman
Joseph Weston
Jeff Wheeler
Jeff Wheeler
Christopher White
Christopher White
David White
David White
...
...
Misc/NEWS
Dosyayı görüntüle @
36f22a28
...
@@ -29,6 +29,9 @@ Library
...
@@ -29,6 +29,9 @@ Library
Documentation
Documentation
-------------
-------------
- Issue #24808: Update the types of some PyTypeObject fields. Patch by
Joseph Weston.
- Issue #22812: Fix unittest discovery examples.
- Issue #22812: Fix unittest discovery examples.
Patch from Pam McA'
Nulty
.
Patch from Pam McA'
Nulty
.
...
...
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