3 ms·
This sort of thing makes me think Python is very complex: What `instance.foobar` actually does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metacla
by pansa2 2y ago
This sort of thing makes me think Python is very complex:
What `instance.foobar` actually does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#object-attribute-lookup https://blog.ionelmc.ro/2015/02/09/understanding-python-meta...
Unless `instance` is actually a class, in which case it does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#class-attribute-lookup https://blog.ionelmc.ro/2015/02/09/understanding-python-meta...
Unless it's looking up a special method (`__add__` etc), in which case it does something different again.
This is much more complex than say, Ruby, which does the same thing in all three cases.