[issue35105] Document that CPython accepts "invalid" identifiers

Roy Smith report at bugs.python.org
Thu Jul 2 17:26:59 EDT 2020


Roy Smith <roy at panix.com> added the comment:

Just as another edge case, type() can do the same thing:

Foo = type("Foo", (object,), {"a b": 1})
f = Foo()

for example, will create a class attribute named "a b".  Maybe this actually calls setattr() under the covers, but if it's going to be documented, it should be noted in both places.

----------
nosy: +roysmith

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


More information about the Python-bugs-list mailing list