Re: Attribute reference design

2008-07-02 Thread Cédric Lucantis
Le Wednesday 02 July 2008 01:17:21 Gary Herron, vous avez écrit : > chamalulu wrote: > > 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 insta

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-02 Thread Bruno Desthuilliers
chamalulu a écrit : 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() ..

Re: Attribute reference design

2008-07-01 Thread Gary Herron
chamalulu wrote: 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() ..

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 Gary Herron
chamalulu wrote: 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 scope of the instance, Python looks for

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 > > scope of the instance, Python looks for a class at

Re: Attribute reference design

2008-07-01 Thread Diez B. Roggisch
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 scope of the instance, Python looks for a class attribute with the same name. (For assignment or deletion this is not the case, thankf

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