Message251248
An identifier is defined by
identifier ::= (letter|"_") (letter | digit | "_")*
setattr accepts identifiers that do not meet this criterion:
<pre>
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(object): pass
...
>>> o=C()
>>> setattr(o, "$$$", True)
>>> dir(o)
['$$$', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__in
module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__su
__', '__weakref__']
>>> o.$$$
File "<stdin>", line 1
o.$$$
^
SyntaxError: invalid syntax
>>>
</pre> |
|
Date |
User |
Action |
Args |
2015-09-21 18:59:20 | W deW | set | recipients:
+ W deW |
2015-09-21 18:59:20 | W deW | set | messageid: <1442861960.51.0.201067879836.issue25205@psf.upfronthosting.co.za> |
2015-09-21 18:59:20 | W deW | link | issue25205 messages |
2015-09-21 18:59:19 | W deW | create | |
|