Skip to content

Commit 438b1d6

Browse files
committed
Use standard worning for joint inheritance and "slot" signature
1 parent 3e5f5b0 commit 438b1d6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Doc/c-api/typeobj.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ and :c:type:`PyType_Type` effectively act as defaults.)
678678
This field is only used if the flag :const:`_Py_TPFLAGS_HAVE_VECTORCALL`
679679
is set. If so, this must be a positive integer containing the offset in the
680680
instance of a :c:type:`vectorcallfunc` pointer.
681-
Arguments to ``vectorcallfunc`` are the same as for :c:func:`_PyObject_Vectorcall`.
681+
The signature is the same as for :c:func:`_PyObject_Vectorcall`::
682+
683+
PyObject *vectorcallfunc(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
682684

683685
The *vectorcallfunc* pointer may be zero, in which case the instance behaves
684686
as if :const:`_Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the instance
@@ -707,10 +709,14 @@ and :c:type:`PyType_Type` effectively act as defaults.)
707709
708710
**Inheritance:**
709711
710-
This slot is inherited for static extension types
711-
together with the flag :const:`_Py_TPFLAGS_HAVE_VECTORCALL`,
712-
but only if :c:member:`~PyTypeObject.tp_call` is also inherited.
713-
`Heap types`_ never inherit this.
712+
This field is inherited by *static* subtypes together with
713+
:c:member:`~PyTypeObject.tp_call`: a subtype inherits both
714+
:c:member:`~PyTypeObject.tp_vectorcall_offset` and
715+
:c:member:`~PyTypeObject.tp_call` from its base type when the subtype’s
716+
:c:member:`~PyTypeObject.tp_call` and :c:member:`~PyTypeObject.tp_vectorcall_offset`
717+
are both NULL.
718+
719+
`Heap types`_ never inherit :c:member:`~PyTypeObject.tp_vectorcall_offset`.
714720
715721
716722
.. c:member:: getattrfunc PyTypeObject.tp_getattr

0 commit comments

Comments
 (0)