Object Implementation Support¶
This chapter describes the functions, types, and macros used when defining new object types.
- Allocating Objects on the Heap
- Common Object Structures
- Type Objects
- Quick Reference
- PyTypeObject Definition
- PyObject Slots
- PyVarObject Slots
- PyTypeObject Slots
tp_nametp_basicsizetp_itemsizetp_dealloctp_vectorcall_offsettp_getattrtp_setattrtp_as_asynctp_reprtp_as_numbertp_as_sequencetp_as_mappingtp_hashtp_calltp_strtp_getattrotp_setattrotp_as_buffertp_flagsPy_TPFLAGS_HEAPTYPEPy_TPFLAGS_BASETYPEPy_TPFLAGS_READYPy_TPFLAGS_READYINGPy_TPFLAGS_HAVE_GCPy_TPFLAGS_DEFAULTPy_TPFLAGS_METHOD_DESCRIPTORPy_TPFLAGS_LONG_SUBCLASSPy_TPFLAGS_LIST_SUBCLASSPy_TPFLAGS_TUPLE_SUBCLASSPy_TPFLAGS_BYTES_SUBCLASSPy_TPFLAGS_UNICODE_SUBCLASSPy_TPFLAGS_DICT_SUBCLASSPy_TPFLAGS_BASE_EXC_SUBCLASSPy_TPFLAGS_TYPE_SUBCLASSPy_TPFLAGS_HAVE_FINALIZEPy_TPFLAGS_HAVE_VECTORCALLPy_TPFLAGS_IMMUTABLETYPEPy_TPFLAGS_DISALLOW_INSTANTIATIONPy_TPFLAGS_MAPPINGPy_TPFLAGS_SEQUENCE
tp_doctp_traversetp_cleartp_richcomparetp_weaklistoffsettp_itertp_iternexttp_methodstp_memberstp_getsettp_basetp_dicttp_descr_gettp_descr_settp_dictoffsettp_inittp_alloctp_newtp_freetp_is_gctp_basestp_mrotp_cachetp_subclassestp_weaklisttp_deltp_version_tagtp_finalizetp_vectorcall
- Static Types
- Heap Types
- Number Object Structures
PyNumberMethodsnb_addnb_subtractnb_multiplynb_remaindernb_divmodnb_powernb_negativenb_positivenb_absolutenb_boolnb_invertnb_lshiftnb_rshiftnb_andnb_xornb_ornb_intnb_reservednb_floatnb_inplace_addnb_inplace_subtractnb_inplace_multiplynb_inplace_remaindernb_inplace_powernb_inplace_lshiftnb_inplace_rshiftnb_inplace_andnb_inplace_xornb_inplace_ornb_floor_dividenb_true_dividenb_inplace_floor_dividenb_inplace_true_dividenb_indexnb_matrix_multiplynb_inplace_matrix_multiply
- Mapping Object Structures
- Sequence Object Structures
- Buffer Object Structures
- Async Object Structures
- Slot Type typedefs
allocfuncdestructorfreefuncnewfuncinitprocreprfuncgetattrfuncsetattrfuncgetattrofuncsetattrofuncdescrgetfuncdescrsetfunchashfuncrichcmpfuncgetiterfunciternextfunclenfuncgetbufferprocreleasebufferprocunaryfuncbinaryfuncsendfuncternaryfuncssizeargfuncssizeobjargprocobjobjprocobjobjargproc
- Examples
- Supporting Cyclic Garbage Collection