-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
Micropython:
>>> class Foo:
... pass
>>> t = Foo()
>>> t.__dict__
{}
>>> t.__dict__['a'] = 4
>>> t.__dict__
{}
>>> t.a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Foo' object has no attribute 'a'
Python3:
>>> class Foo:
... pass
...
>>> t = Foo()
>>> t.__dict__
{}
>>> t.__dict__['a'] = 4
>>> t.__dict__
{'a': 4}
>>> t.a
4
Same applies for t.__dict__.update(another_dict)
Metadata
Metadata
Assignees
Labels
No labels