Author gvanrossum
Recipients gvanrossum, vstinner
Date 2021-04-21.18:52:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hi Victor,

Sorry for making this a deferred blocker. I recall that we had a brief discussion somewhere about an accidental change to the array.array type -- this is now a heap type (Py_TPFLAGS_HEAPTYPE is set), and as a consequence it is no longer immutable.

In 3.9 this is an error:

>>> import array        
>>> = 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't set attributes of built-in/extension type 'array.array'

But in 3.10a7 it passes:

>>> = 1

I would like this type (and other types that have been or will be converted to heap types) to remain immutable. How can we do that? I think we may need a new flag bit meaning "built-in type, immutable". This bit should not be inherited of course.

What do you think? (Feel free to close if this is a duplicate -- I couldn't find where we discussed this previously, sorry.)
Date User Action Args
2021-04-21 18:52:19gvanrossumsetrecipients: + gvanrossum, vstinner
2021-04-21 18:52:19gvanrossumsetmessageid: <>
2021-04-21 18:52:19gvanrossumlinkissue43908 messages
2021-04-21 18:52:19gvanrossumcreate