You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, get_attribute_hook() is only called for attributes that are already present in the class symbol table. However, the typical use case is opposite -- dynamically added attributes. Therefore, the current behavior creates some complications while developing plugins, like every access to dynamic attribute first requires somehow placing it into the class symbol table using other hooks. I propose to widen the scope of get_attribute_hook() to at least be called for classes with __getattr__().
The text was updated successfully, but these errors were encountered:
Whenever we find __getattr__ or __getattribute__ on an instance, the getattribute hook is used.
(It continues to be used whenever we find a method or variable on an instance)
Closespython#6259, python#5910
Whenever we find `__getattr__` or `__getattribute__` on an instance, the getattribute hook is called to give the hook a chance to modify the return type of one of those functions.
Closes#6259, #5910
Currently,
get_attribute_hook()
is only called for attributes that are already present in the class symbol table. However, the typical use case is opposite -- dynamically added attributes. Therefore, the current behavior creates some complications while developing plugins, like every access to dynamic attribute first requires somehow placing it into the class symbol table using other hooks. I propose to widen the scope ofget_attribute_hook()
to at least be called for classes with__getattr__()
.The text was updated successfully, but these errors were encountered: