[issue43908] array.array should remain immutable

Erlend Egeberg Aasland report at bugs.python.org
Thu Apr 22 04:20:29 EDT 2021


Erlend Egeberg Aasland <erlend.aasland at innova.no> added the comment:

FWIW, I was the one who converted arraymodule to use heap types in 75bf107c62fbdc00af51ee4f6ab69df4bd201104 (GH-23124) in January. Sorry 'bout the accidental change of behaviour.

> I think we may need a new flag bit meaning "built-in type, immutable". This bit should not be inherited of course.

+1.

See attached PoC patch. As far as I understand, type flags must be explicitly inherited in Objects/typeobject.c, no?

Should all previous static types be immutable, or are there exceptions?

----------
keywords: +patch
Added file: https://bugs.python.org/file49970/patch.diff

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


More information about the Python-bugs-list mailing list