Message130522
| Author |
alex |
| Recipients |
alex, daniel.urban, loewis, michael.foord, pitrou, stutzbach |
| Date |
2011年03月10日.18:53:44 |
| SpamBayes Score |
4.2834364e-07 |
| Marked as misclassified |
No |
| Message-id |
<1299783228.52.0.918181328211.issue11455@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
How can they be set afterwords?
alex@alex-laptop:~/projects/pypy$ python3.1
Python 3.1.2 (release31-maint, Sep 17 2010, 20:34:23)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
... pass
...
>>> A.__dict__[32] = "heh"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'dict_proxy' object does not support item assignment
>>> setattr(A, 32, "heh")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: attribute name must be string, not 'int' |
|