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
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
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()
..
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()
..
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
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
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
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