summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/typeobj.rst17
-rw-r--r--Doc/whatsnew/3.11.rst5
2 files changed, 14 insertions, 8 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index ea81115..004cecd 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -710,7 +710,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
.. warning::
- It is not recommended for :ref:`heap types <heap-types>` to implement
+ It is not recommended for :ref:`mutable heap types <heap-types>` to implement
the vectorcall protocol.
When a user sets :attr:`__call__` in Python code, only *tp_call* is updated,
likely making it inconsistent with the vectorcall function.
@@ -734,8 +734,9 @@ and :c:type:`PyType_Type` effectively act as defaults.)
always inherited. If it's not, then the subclass won't use
:ref:`vectorcall <vectorcall>`, except when
:c:func:`PyVectorcall_Call` is explicitly called.
- This is in particular the case for :ref:`heap types <heap-types>`
- (including subclasses defined in Python).
+ This is in particular the case for types without the
+ :const:`Py_TPFLAGS_IMMUTABLETYPE` flag set (including subclasses defined in
+ Python).
.. c:member:: getattrfunc PyTypeObject.tp_getattr
@@ -1125,9 +1126,9 @@ and :c:type:`PyType_Type` effectively act as defaults.)
**Inheritance:**
- This flag is never inherited by :ref:`heap types <heap-types>`.
- For extension types, it is inherited whenever
- :c:member:`~PyTypeObject.tp_descr_get` is inherited.
+ This flag is never inherited by types without the
+ :const:`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is
+ inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited.
.. XXX Document more flags here?
@@ -1172,9 +1173,9 @@ and :c:type:`PyType_Type` effectively act as defaults.)
**Inheritance:**
- This bit is inherited for :ref:`static subtypes <static-types>` if
+ This bit is inherited for types with the
+ :const:`Py_TPFLAGS_IMMUTABLETYPE` flag set, if
:c:member:`~PyTypeObject.tp_call` is also inherited.
- :ref:`Heap types <heap-types>` do not inherit ``Py_TPFLAGS_HAVE_VECTORCALL``.
.. versionadded:: 3.9
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 5b58ef6..bfadda1 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -214,6 +214,11 @@ Porting to Python 3.11
(:c:member:`PyTypeObject.tp_traverse`).
(Contributed by Victor Stinner in :issue:`44263`.)
+* Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit
+ the :pep:`590` vectorcall protocol. Previously, this was only possible for
+ :ref:`static types <static-types>`.
+ (Contributed by Erlend E. Aasland in :issue:`43908`)
+
Deprecated
----------