[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

STINNER Victor report at bugs.python.org
Fri Apr 30 07:35:11 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

Erlend: would you mind to document the new Py_TPFLAGS_IMMUTABLETYPE flag in the C API section of What's New in Python 3.10?
https://docs.python.org/dev/whatsnew/3.10.html#c-api-changes

In "New Features", something like:

* Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to (...).
  (Contributed by xxx in :issue:`43908`.)

And in the "Porting to Python 3.10", I don't know if we should suggest reviewing metatypes implemented in C which overrides tp_setattro, to take the new flag in account.

Maybe explain that Py_TPFLAGS_IMMUTABLETYPE should now be checked to decide if a type is mutable or not, rather than relying on Py_TPFLAGS_HEAPTYPE.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43908>
_______________________________________


More information about the Python-bugs-list mailing list