This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lnenov
Recipients lnenov
Date 2012-02-16.09:01:59
SpamBayes Score 1.7716076e-05
Marked as misclassified No
Message-id <1329382920.47.0.960341753942.issue14029@psf.upfronthosting.co.za>
In-reply-to
Content
I am not sure if this is actually a bug. 

Given documentation @ http://docs.python.org/release/2.5.2/ref/identifiers.html, the issue is that setattr does not appear to check identifier for naming convention.

See a short example below. Running on windows

>>> sys.version_info(major=2, minor=7, micro=1, releaselevel='final', serial=0)
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=1, releaselevel='final', serial=0)
>>> class Example():
	pass
>>> example = Example()
>>> example.@foo = 4
SyntaxError: invalid syntax
>>> setattr(example, '@foo', 'bar')
>>> dir(example)
['@foo', '__doc__', '__module__']
>>> example.@foo
SyntaxError: invalid syntax
>>> getattr(example, '@foo')
'bar'
History
Date User Action Args
2012-02-16 09:02:00lnenovsetrecipients: + lnenov
2012-02-16 09:02:00lnenovsetmessageid: <1329382920.47.0.960341753942.issue14029@psf.upfronthosting.co.za>
2012-02-16 09:01:59lnenovlinkissue14029 messages
2012-02-16 09:01:59lnenovcreate