Try this:
class Class:
a='aa'
b='bb'
def __getattr__(self, ppt):
return 'custom computed result'
__getattr__ is only called when "normal" attribute lookup fails, so
there's no need for the "hasattr" test.
Also, I believe that __getattribute__ only applies to new-style c
Try this:
class Class:
a='aa'
b='bb'
def __getattr__(self, ppt):
return 'custom computed result'
__getattr__ is only called when "normal" attribute lookup fails, so
there's no need for the "hasattr" test.
Also, I believe that __getattribute__ only applies to new-style cla
Try this:
class Class:
a='aa'
b='bb'
def __getattr__(self, ppt):
return 'custom computed result'
__getattr__ is only called when "normal" attribute lookup fails, so
there's no need for the "hasattr" test.
Also, I believe that __getattribute__ only applies to new-style cl
I tested the exact code I sent you on python 2.4.1. What version of
Python are you using?
Thanks,
Rick
Pierre wrote:
> Nop I get the same AttributeError when I try to access to the property
> "c"...
>
--
http://mail.python.org/mailman/listinfo/python-list
I tested the exact code I sent you on python 2.4.1. What version of
Python are you using?
Thanks,
Rick
Pierre wrote:
> Nop I get the same AttributeError when I try to access to the property
> "c"...
>
--
http://mail.python.org/mailman/listinfo/python-list