metaclass adding invalid attribute to class?
Here is my code:
def __metaclass__(clsname, bases, dct):
dct["key1"] = "value1"
dct["invalid identifier"] = "value2"
return type(clsname, bases, dct)
class Cls():
pass
for name in dir(Cls):
if not name.startswith("_"):
print name
when I run it, I got:
>>>
invalid identifier
key1
>>>
Is is possible to access the invalid identifier?