8000 Add What's New entry · python/cpython@075ca51 · GitHub
[go: up one dir, main page]

Skip to content

Commit 075ca51

Browse files
committed
Add What's New entry
1 parent 1fc5c52 commit 075ca51

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,21 @@ New Features
10141014

10151015
(Contributed by Petr Viktorin in :gh:`101101`.)
10161016

1017+
* :pep:`697`: Added API for extending types whose instance memory layout is
1018+
opaque:
1019+
1020+
- :c:member:`PyType_Spec.basicsize` can be zero or negative to specify
1021+
inheriting or extending the base class size.
1022+
- :c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize`
1023+
added to allow access to subclass-specific instance data.
1024+
- :c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData`
1025+
added to allow safely extending certain variable-sized types, including
1026+
:c:var:`PyType_Type`.
1027+
- :c:macro:`Py_RELATIVE_OFFSET` added to allow defining
1028+
:c:type:`members <PyMemberDef>` in terms of a subclass-specific struct.
1029+
1030+
(Contributed by Petr Viktorin in :gh:`103509`.)
1031+
10171032
* Added the new limited C API function :c:func:`PyType_FromMetaclass`,
10181033
which generalizes the existing :c:func:`PyType_FromModuleAndSpec` using
10191034
an additional metaclass argument.

0 commit comments

Comments
 (0)
0