Lines Matching refs:macro
27 members must be done by using the macros :c:macro:`Py_REFCNT` and
28 :c:macro:`Py_TYPE`.
37 :c:macro:`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`.
40 .. c:macro:: PyObject_HEAD
42 This is a macro used when declaring new types which represent objects
43 without a varying length. The PyObject_HEAD macro expands to::
50 .. c:macro:: PyObject_VAR_HEAD
52 This is a macro used when declaring new types which represent objects
54 The PyObject_VAR_HEAD macro expands to::
61 .. c:macro:: Py_TYPE(o)
63 This macro is used to access the :attr:`ob_type` member of a Python object.
69 .. c:macro:: Py_REFCNT(o)
71 This macro is used to access the :attr:`ob_refcnt` member of a Python
78 .. c:macro:: Py_SIZE(o)
80 This macro is used to access the :attr:`ob_size` member of a Python object.
86 .. c:macro:: PyObject_HEAD_INIT(type)
88 This is a macro which expands to initialization values for a new
89 :c:type:`PyObject` type. This macro expands to::
95 .. c:macro:: PyVarObject_HEAD_INIT(type, size)
97 This is a macro which expands to initialization values for a new
99 This macro expands to::
286 :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that
287 :c:macro:`T_OBJECT` returns ``None`` if the member is *NULL* and
288 :c:macro:`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use
289 :c:macro:`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX`
291 than :c:macro:`T_OBJECT`.
293 :attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` for
294 read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies
295 :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX`