Common Object Structures — Python 3.11.16 documentation

docs.python.org

Tin mới

Allocating Objects on the Heap

Python Module Index

3.11.16 Documentation

Python/C API Reference Manual

Object Implementation Support

PyVarObject.ob_size

This is an extension of PyObject that adds the ob_size field. This is only used for objects that have some notion of length. This type does not often appear in the Python/C API. Access to the members must be done by usin

borrowed reference

Use the Py_SET_TYPE() function to set an object type.

PyArg_ParseTuple()

This is the typical calling convention, where the methods have the type PyCFunction. The function expects two PyObject* values. The first one is the self object for methods; for module functions, it is the module object.

vectorcall protocol

object.__contains__