diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-15 18:43:20 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-15 18:43:20 (GMT) |
commit | c63042bcc47b81eb0fd8053a79f2443f2ef4396d (patch) | |
tree | a017cb49c925c984ab403088bceae9b664ddbb5a /Doc/texinputs | |
parent | 0fe940c862fef8729f07b5686847e7e952b40fe6 (diff) | |
download | cpython-c63042bcc47b81eb0fd8053a79f2443f2ef4396d.zip cpython-c63042bcc47b81eb0fd8053a79f2443f2ef4396d.tar.gz cpython-c63042bcc47b81eb0fd8053a79f2443f2ef4396d.tar.bz2 |
Move the listing of the type structure, since both the C API reference and
the Extending & Embedding manual use it.
Diffstat (limited to 'Doc/texinputs')
-rw-r--r-- | Doc/texinputs/typestruct.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Doc/texinputs/typestruct.h b/Doc/texinputs/typestruct.h new file mode 100644 index 0000000..0afe375 --- /dev/null +++ b/Doc/texinputs/typestruct.h @@ -0,0 +1,76 @@ +typedef struct _typeobject { + PyObject_VAR_HEAD + char *tp_name; /* For printing, in format "<module>.<name>" */ + int tp_basicsize, tp_itemsize; /* For allocation */ + + /* Methods to implement standard operations */ + + destructor tp_dealloc; + printfunc tp_print; + getattrfunc tp_getattr; + setattrfunc tp_setattr; + cmpfunc tp_compare; + reprfunc tp_repr; + + /* Method suites for standard classes */ + + PyNumberMethods *tp_as_number; + PySequenceMethods *tp_as_sequence; + PyMappingMethods *tp_as_mapping; + + /* More standard operations (here for binary compatibility) */ + + hashfunc tp_hash; + ternaryfunc tp_call; + reprfunc tp_str; + getattrofunc tp_getattro; + setattrofunc tp_setattro; + + /* Functions to access object as input/output buffer */ + PyBufferProcs *tp_as_buffer; + + /* Flags to define presence of optional/expanded features */ + long tp_flags; + + char *tp_doc; /* Documentation string */ + + /* Assigned meaning in release 2.0 */ + /* call function for all accessible objects */ + traverseproc tp_traverse; + + /* delete references to contained objects */ + inquiry tp_clear; + + /* Assigned meaning in release 2.1 */ + /* rich comparisons */ + richcmpfunc tp_richcompare; + + /* weak reference enabler */ + long tp_weaklistoffset; + + /* Added in release 2.2 */ + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + struct PyMethodDef *tp_methods; + struct PyMemberDef *tp_members; + struct PyGetSetDef *tp_getset; + struct _typeobject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + long tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + freefunc tp_free; /* Low-level free-memory routine */ + inquiry tp_is_gc; /* For PyObject_IS_GC */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_cache; + PyObject *tp_subclasses; + PyObject *tp_weaklist; + +} PyTypeObject; |