8000 GH-95245: Document use of `MANAGED` flags instead of offsets. by markshannon · Pull Request #96044 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-95245: Document use of MANAGED flags instead of offsets. #96044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Implement mdboom's suggestions.
  • Loading branch information
markshannon committed Aug 30, 2022
commit a508c008e4d2d9fa6f1d833d9216387e2d8bd2a8
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is the dictionary for
attributes of the type object itself.

The value specifies the offset from the start of the instance structure.
The value specifies the offset of the dictionary from the start of the instance structure.

The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-only.
To get the pointer to the dictionary call :c:func:`PyObject_GenericGetDict`.
Expand Down
3 changes: 1 addition & 2 deletions Doc/extending/newtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ Concretely, here is how the statically declared type object would look::


The only further addition is that ``tp_dealloc`` needs to clear any weak
references (by calling :c:func:`PyObject_ClearWeakRefs`) if the field is
non-``NULL``::
references (by calling :c:func:`PyObject_ClearWeakRefs`)::

static void
Trivial_dealloc(TrivialObject *self)
Expand Down
0