Re: multiple inheritance and __getattr__

2008-07-29 Thread Enrico
Bruno Desthuilliers [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] Indeed. You explicitely raise, so the lookup stops here. You'd need to explicitely call on superclass instead to have B.__getattr__ called, ie: class A(object): def __getattr__(self, name): if

Re: multiple inheritance and __getattr__

2008-07-29 Thread Maric Michaud
if this has a reason, if it is a design choice or what else, any explanation is welcome. No getattr is a lookup fallback, classes which implement them in a non-collaborative way are unlikely to be used for multiple inheritance. Given how multiple inheritance work and __getattr__ semantic, I was surprised

Re: multiple inheritance and __getattr__

2008-07-29 Thread David C. Ullrich
In article [EMAIL PROTECTED], Bruno Desthuilliers [EMAIL PROTECTED] wrote: Enrico a écrit : Hi there, I have the following situation (I tryed to minimize the code to concentrate on the issue): class A(object): def __getattr__(self, name): print 'A.__getattr__' if name ==

multiple inheritance and __getattr__

2008-07-28 Thread Enrico
Hi there, I have the following situation (I tryed to minimize the code to concentrate on the issue): class A(object): def __getattr__(self, name): print 'A.__getattr__' if name == 'a': return 1 raise AttributeError('%s not found in A' % name) class B(object): def __getattr__(self,

Re: multiple inheritance and __getattr__

2008-07-28 Thread David C. Ullrich
In article [EMAIL PROTECTED], Enrico [EMAIL PROTECTED] wrote: Hi there, I have the following situation (I tryed to minimize the code to concentrate on the issue): class A(object): def __getattr__(self, name): print 'A.__getattr__' if name == 'a': return 1 raise

Re: multiple inheritance and __getattr__

2008-07-28 Thread Bruno Desthuilliers
Enrico a écrit : Hi there, I have the following situation (I tryed to minimize the code to concentrate on the issue): class A(object): def __getattr__(self, name): print 'A.__getattr__' if name == 'a': return 1 raise AttributeError('%s not found in A' % name) class B(object): def