Skip to content

Commit b351b2c

Browse files
committed
Add/adjust comments & news entries
1 parent 708cd82 commit b351b2c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Doc/c-api/type.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ Type Objects
108108
.. versionadded:: 3.4
109109
110110
.. versionchanged:: 3.10
111-
:c:func:`PyType_GetSlot` could accept static types.
111+
:c:func:`PyType_GetSlot` can now accept all types.
112+
Previously, it was limited to heap types.
112113
113114
.. c:function:: PyObject* PyType_GetModule(PyTypeObject *type)
114115
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:c:func:`PyType_GetSlot()` could accept static types.
1+
:c:func:`PyType_GetSlot()` can now accept static types.

Objects/typeobject.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,16 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
28752875
return NULL;
28762876
}
28772877

2878+
/* An array of type slot offsets corresponding to Py_tp_* constants,
2879+
* for use in e.g. PyType_Spec and PyType_GetSlot.
2880+
* Each entry has two offsets: "slot_offset" and "subslot_offset".
2881+
* If is subslot_offset is -1, slot_offset is an offset within the
2882+
* PyTypeObject struct.
2883+
* Otherwise slot_offset is an offset to a pointer to a sub-slots struct
2884+
* (such as "tp_as_number"), and subslot_offset is the offset within
2885+
* that struct.
2886+
* The actual table is generated by a script.
2887+
*/
28782888
static const PySlot_Offset pyslot_offsets[] = {
28792889
{0, 0},
28802890
#include "typeslots.inc"

0 commit comments

Comments
 (0)