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.__getatt
Le Monday 28 July 2008 16:48:09 Enrico, vous avez é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 AttributeE
"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):
>
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 __
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
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,