Guido van Rossum <gu...@python.org> added the comment:

My main concern is that types that were immutable in previous Python versions 
shouldn't become mutable as a surprise side effect of making them heap types. I 
don't know which types have become mutable this way though.

My other concern is that the language design *intentionally* disallowed 
mutating built-in types (unlike some other languages that allow it, e.g. Ruby). 
Mutating built-in types is one of those "attractive nuisance" anti-patterns 
where at a small scale this often appears to be the quickest way to solve a 
problem, but it tends to break unrelated things in larger-scale  applications 
(when different libraries using such tricks collide).

(There's also a concern about mutating types that are shared between multiple 
interpreters, but IIUC heap types are not shared, so this shouldn't be a 
problem.)

Presumably we should review the list of heap types that you are proposing to 
make immutable (in a form more easily digestible by humans than a diff) and 
reach agreement on that. And perhaps the list should include information on 
when a type became a heap type. (Types that were always heap types probably 
needn't be changed.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43908>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to