[issue24912] The type of cached objects is mutable

Nathaniel Smith report at bugs.python.org
Tue Sep 1 05:18:15 CEST 2015


Nathaniel Smith added the comment:

On further thought, here's a slightly improved version of the patch I posted above.

The difference is that the first version allowed through attempted __class__ assignments where either the old or new class was a subclass of ModuleType; the new version only allows through attempted assignments if both the old AND new class are a subclass of ModuleType.

In practice this doesn't make any difference, because the compatibility-checking code will reject any attempt to switch from a ModuleType subclass to a non ModuleType subclass or vice-versa. So both patches are correct. But the new patch is more obviously correct.

----------
Added file: http://bugs.python.org/file40312/issue24912-v2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24912>
_______________________________________


More information about the Python-bugs-list mailing list