My apologies if this is one of those "dead horse" issues.  The
following seems a little inconsistent to me:

>>> c = C()
>>> c.None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: C instance has no attribute 'None'
>>> c.None = 'foo'
  File "<stdin>", line 1
SyntaxError: assignment to None
>>> setattr(c, 'None', 'foo')
>>> c.None
'foo'
>>>

So, it's okay to setattr the attribute name "None" but not okay to set
it directly?  Is this deliberate or is it an unintentional side effect
of parser changes to prevent assignment to None?

--
Curt Hagenlocher
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to