[docs] [issue4600] __class__ assignment: new-style? heap? == confusing

Benjamin Peterson report at bugs.python.org
Sun Feb 27 19:25:43 CET 2011


Benjamin Peterson <benjamin at python.org> added the comment:

This is not really accurate:

>>> class x(int): pass
... 
>>> class y(object): pass
... 
>>> x().__class__ = y
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: 'x' object layout differs from 'y'
>>> y().__class__ = x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: 'y' object layout differs from 'x'

----------
nosy: +benjamin.peterson

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


More information about the docs mailing list