GH-95245: Document use of MANAGED flags instead of offsets.#96044
GH-95245: Document use of MANAGED flags instead of offsets.#96044markshannon merged 5 commits intopython:mainfrom
MANAGED flags instead of offsets.#96044Conversation
|
|
||
| The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and | ||
| :c:member:`~PyTypeObject.tp_weaklistoffset` are still supported, but extensions are | ||
| strongly encouraged to use ``Py_TPFLAGS_MANAGED_DICT`` and |
There was a problem hiding this comment.
Can Py_TPFLAGS_MANAGED_DICT and Py_TPFLAGS_MANAGED_WEAKREF link to their definition in typeobj.rst below?
There was a problem hiding this comment.
:c:member:~PyTypeObject.tp_dictoffset` converts to a link to
https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_dictoffset
I don't think I can link into the table.
| | | | __ge__ | | | | | | ||
| +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ | ||
| | :c:member:`~PyTypeObject.tp_weaklistoffset` | :c:type:`Py_ssize_t` | | | X | | ? | | ||
| | (:c:member:`~PyTypeObject.tp_weaklistoffset`) | :c:type:`Py_ssize_t` | | | X | | ? | |
There was a problem hiding this comment.
The parentheses indicate deprecation? Should we maybe say "(Deprecated in Python 3.12)" instead?
There was a problem hiding this comment.
The docs are always relevant to the current version, so it is implicit that this applies to 3.12.
This isn't a formal deprecation, more of a hint not to use these fields.
| | | | __delete__ | | | | | | ||
| +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ | ||
| | :c:member:`~PyTypeObject.tp_dictoffset` | :c:type:`Py_ssize_t` | | | X | | ? | | ||
| | (:c:member:`~PyTypeObject.tp_dictoffset`) | :c:type:`Py_ssize_t` | | | X | | ? | |
There was a problem hiding this comment.
Same as above regarding deprecation.
Uh oh!
There was an error while loading. Please reload this page.