File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -537,6 +537,9 @@ PyVarObject Slots
537537 initialized to zero. For :ref: `dynamically allocated type objects
538538 <heap-types>`, this field has a special internal meaning.
539539
540+ This field should be accessed using the :c:func: `Py_SIZE() ` and
541+ :c:func: `Py_SET_SIZE() ` macros.
542+
540543 **Inheritance: **
541544
542545 This field is not inherited by subtypes.
@@ -611,6 +614,11 @@ and :c:data:`PyType_Type` effectively act as defaults.)
611614 way; the underlying storage and its size should be acessed using
612615 :c:func: `PyLong_Export `.
613616
617+ .. note ::
618+
619+ The :c:member: `~PyVarObject.ob_size ` field should be accessed using
620+ the :c:func: `Py_SIZE() ` and :c:func: `Py_SET_SIZE() ` macros.
621+
614622 Also, the presence of an :c:member: `~PyVarObject.ob_size ` field in the
615623 instance layout doesn't mean that the instance structure is variable-length.
616624 For example, the :py:type: `list ` type has fixed-length instances, yet those
You can’t perform that action at this time.
0 commit comments