Message329274
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. |
|
Date |
User |
Action |
Args |
2018-11-04 23:12:15 | steven.daprano | set | recipients:
+ steven.daprano, docs@python, denis-osipov |
2018-11-04 23:12:15 | steven.daprano | set | messageid: <1541373135.04.0.788709270274.issue35165@psf.upfronthosting.co.za> |
2018-11-04 23:12:15 | steven.daprano | link | issue35165 messages |
2018-11-04 23:12:14 | steven.daprano | create | |
|