Message129643
Here comes a patch, changing the behaviour to:
./python -q
>>> class C:
... pass
...
>>> (1).__class__ = 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __class__ must be set to a class defined by a class statement, not 'int' object
>>> (1).__class__ = object
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: class__ must be set to a class defined by a class statement, not 'object'
>>> (1).__class__ = C
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: only for instances of classes defined by class statements |
|
Date |
User |
Action |
Args |
2011-02-27 18:00:32 | jonash | set | recipients:
+ jonash, terry.reedy, stutzbach, Trundle, docs@python |
2011-02-27 18:00:32 | jonash | set | messageid: <1298829632.48.0.301800168145.issue4600@psf.upfronthosting.co.za> |
2011-02-27 18:00:31 | jonash | link | issue4600 messages |
2011-02-27 18:00:31 | jonash | create | |
|