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
{{ message }}
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
The fact is I was not aware of the existence of __getattribute__. As the difference seems to be __getattr__ is called when no attribute was found, while __getattribute__ is always called (both and Python2 and Python3), I think that __getattr__ is the correct method to call here: we first check on the manager itself, then we proxy to the queryset. However, I'm possibly missing something here.
Still from that perspective, however, the try block is superfluous: if __getattr__ is called, it means no attribute has been found on the manager itself.
because is the standard way of accessing an attribute in an object. getattr actually implement the Python mechanism for attributes' retrieval that involves also __getattr__ and __getattribute__ use.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
From a Python3 perspective, is it not wrong to use
__getattr__
here instead of__getattribute__
? Is there any design decision involved?The text was updated successfully, but these errors were encountered: