Author W deW
Recipients W deW
Date 2015-09-21.18:59:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442861960.51.0.201067879836.issue25205@psf.upfronthosting.co.za>
In-reply-to
Content
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>
History
Date User Action Args
2015-09-21 18:59:20W deWsetrecipients: + W deW
2015-09-21 18:59:20W deWsetmessageid: <1442861960.51.0.201067879836.issue25205@psf.upfronthosting.co.za>
2015-09-21 18:59:20W deWlinkissue25205 messages
2015-09-21 18:59:19W deWcreate