[Python-Dev] Attribute lookup ambiguity (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 23 23:47:00 CET 2010


Pascal Chambon wrote:

All I've found is "If the class also defines getattr(), the latter will not be called unless getattribute() either calls it explicitly or raises an AttributeError

Hmmm. Well, it still implies that there is some mechanism outside of getattribute that will catch an AttributeError and call getattr for you. Given the existence of that mechanism, it seems unlikely that the same thing would be implemented over again in the standard getattribute method.

So I don't think it requires very much guesswork to infer that the standard getattribute won't call getattr on its own.

I concede that the wording could be improved to remove any possibility of doubt, though.

-- Greg



More information about the Python-Dev mailing list