Author ncoghlan
Recipients ncoghlan, njs
Date 2015-09-03.06:08:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Issue #24912 showed that the interpreter has historically assumed that all instances of non-heap types are immutable when it comes to preventing __class__ reassignment, and changing this assumption caused problems with genuinely immutable types that use implicit instance caching (like string interning and the small integrer cache).

More generally, whether or not type instances are mutable or not has been defined somewhat informally - decimal.Decimal instances, for example, are nominally immutable, but this immutability is only by convention, rather than enforced by the interpreter.

It may be desirable to be able to explicitly declare instances of a type as mutable or immutable (both from Python and from C), rather than having that property be inferred from other characteristics in a situational way.
Date User Action Args
2015-09-03 06:08:03ncoghlansetrecipients: + ncoghlan, njs
2015-09-03 06:08:03ncoghlansetmessageid: <>
2015-09-03 06:08:03ncoghlanlinkissue24991 messages
2015-09-03 06:08:02ncoghlancreate