[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: To get a better insight into what is going on, see https://docs.python.org/3/howto/descriptor.html#invocation-from-an-instance The relevant text is, "So if __getattr__() exists, it is called whenever __getattribute__() raises AttributeError (either

[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Mateusz, It's not a bug, it's expected behavior. __getattr__ called when the default attribute access fails with an AttributeError (either __getattribute__() raises an AttributeError because name is not an instance attribute or an

[issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__

2021-08-31 Thread Mateusz
New submission from Mateusz : A descriptor that is raising AttributeError in __get__() causes that the Python's interpreter continues searching for attributes in __mro__ calling __getattr__() function in inherited classes. Let's take a look for example script with this bug. class A1: