Re: Attribute reference design

2008-07-02 Thread chamalulu
On Jul 2, 10:13 am, Bruno Desthuilliers wrote: > Nope. The wrapping happens at lookup time, thru the descriptor protocol > (the same thing that gives support for properties). Aha, I should read up on that. > Help on built-in function dir in module __builtin__: So, the dir function is a little m

Re: Attribute reference design

2008-07-01 Thread chamalulu
On Jul 2, 1:17 am, Gary Herron <[EMAIL PROTECTED]> wrote: > No need. Also, you can define a class attribute (C++ might call it a > static attribute) and access it transparently through an instance. > > class C: > aClassAttribute = 123 > def __init__(self, ...): > ... > > c = C() > ... do

Re: Attribute reference design

2008-07-01 Thread chamalulu
On Jul 1, 11:24 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > chamalulu schrieb: > > > Hello. > > I think I'm aware of how attribute access is resolved in python. When > > referencing a class instance attribute which is not defined in the > &

Attribute reference design

2008-07-01 Thread chamalulu
Hello. I think I'm aware of how attribute access is resolved in python. When referencing a class instance attribute which is not defined in the scope of the instance, Python looks for a class attribute with the same name. (For assignment or deletion this is not the case, thankfully.) I've been tryi