Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

https://docs.python.org/3/reference/expressions.html#attribute-references

__getattr__ is the correct method to override in most (but not all) cases. I 
don't think we should encourage people to override __getattribute__ as the 
first resort.

__getattribute__ is a more specialised method that is used by the interpreter 
at a deeper level. It is called on every attribute access, so it ought to be as 
fast as possible, while __getattr__ is only called if the named attribute 
doesn't exist.

I don't think anything needs to change here.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to