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 catc
Greg Ewing a écrit :
Pascal Chambon wrote:
I don't follow you there - in my mind, the default __getattribute__
could simply have wrapped all its operations inside soem kind of
"try..catch AttributeError:" mechanism, and thus been able to
fallback to __getattr__ in any way.
But then it woul
Pascal Chambon wrote:
I don't follow you there - in my mind, the default __getattribute__
could simply have wrapped all its operations inside soem kind of
"try..catch AttributeError:" mechanism, and thus been able to fallback
to __getattr__ in any way.
But then it would be incorrect to say t
Michael Foord a écrit :
On 20/03/2010 12:00, Pascal Chambon wrote:
But the point which for me is still unclear, is : does the default
implementation of __getattribute__ (the one of "object") call
__getattr__ by himself, or does it rely on its caller for that, by
raising an AttributeError ?
Michael Foord wrote:
Well, the documentation you pointed to specifies that __getattr__ will
be called if __getattribute__ raises an AttributeError, it just doesn't
specify that it is done by object.__getattribute__ (which it isn't).
If __getattribute__ raises an exception, it won't get a chan
Michael Foord wrote:
> Well, the documentation you pointed to specifies that __getattr__ will
> be called if __getattribute__ raises an AttributeError, it just doesn't
> specify that it is done by object.__getattribute__ (which it isn't).
And as for why not: because __getattribute__ implementation
On 20/03/2010 12:00, Pascal Chambon wrote:
Michael Foord a écrit :
On 19/03/2010 18:58, Pascal Chambon wrote:
Hello
I've already crossed a bunch of articles detailing python's
attribute lookup semantic (__dict__, descriptors, order of base
class traversing...), but I have never seen, so far
Michael Foord a écrit :
On 19/03/2010 18:58, Pascal Chambon wrote:
Hello
I've already crossed a bunch of articles detailing python's attribute
lookup semantic (__dict__, descriptors, order of base class
traversing...), but I have never seen, so far, an explanation of
WHICH method did waht,
On 19/03/2010 18:58, Pascal Chambon wrote:
Hello
I've already crossed a bunch of articles detailing python's attribute
lookup semantic (__dict__, descriptors, order of base class
traversing...), but I have never seen, so far, an explanation of WHICH
method did waht, exactly.
I assumed that