[issue33401] `exec` attribute can't be set to objects in Python2 (SyntaxError)

Emanuel Barry report at bugs.python.org
Tue May 1 17:08:42 EDT 2018


Emanuel Barry <barry at dadadata.net> added the comment:

Any valid variable name can be used as a an attribute; for example, "spam" is valid while "spam-eggs" is not. This isn't unique to classes, but to all assignments everywhere. If we allowed `o.exec = blah` then we should also allow `exec = blah` at the global scope and that's a whole load of not happening, much less in Python 2 (which isn't getting any significant updates anymore).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33401>
_______________________________________


More information about the Python-bugs-list mailing list