This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients denis-osipov, docs@python, steven.daprano
Date 2018-11-04.23:12:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541373135.04.0.788709270274.issue35165@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-11-04 23:12:15steven.dapranosetrecipients: + steven.daprano, docs@python, denis-osipov
2018-11-04 23:12:15steven.dapranosetmessageid: <1541373135.04.0.788709270274.issue35165@psf.upfronthosting.co.za>
2018-11-04 23:12:15steven.dapranolinkissue35165 messages
2018-11-04 23:12:14steven.dapranocreate