Message129643
| Author |
jonash |
| Recipients |
Trundle, docs@python, jonash, stutzbach, terry.reedy |
| Date |
2011年02月27日.18:00:31 |
| SpamBayes Score |
1.0289762e-06 |
| Marked as misclassified |
No |
| Message-id |
<1298829632.48.0.301800168145.issue4600@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| 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 |
|