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 eryksun
Recipients W deW, docs@python, eryksun, vstinner
Date 2015-09-21.21:41:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442871678.23.0.401485661448.issue25205@psf.upfronthosting.co.za>
In-reply-to
Content
The name can be any str/unicode string, including language keywords: 

    >>> setattr(o, 'def', 'allowed')
    >>> getattr(o, 'def')
    'allowed'
    >>> o.def
      File "<stdin>", line 1
        o.def
            ^
    SyntaxError: invalid syntax

and even an empty string:

    >>> setattr(o, '', 'mu')
    >>> getattr(o, '')
    'mu'

This includes instances of str and unicode subclasses, at least in CPython.
History
Date User Action Args
2015-09-21 21:41:18eryksunsetrecipients: + eryksun, vstinner, docs@python, W deW
2015-09-21 21:41:18eryksunsetmessageid: <1442871678.23.0.401485661448.issue25205@psf.upfronthosting.co.za>
2015-09-21 21:41:18eryksunlinkissue25205 messages
2015-09-21 21:41:18eryksuncreate