thx for your quick (and complete) answers.
to Alan G :
I will try to see what setattr() and getattr() can do for me. I'm not
used to this stuff.
to Alex Nedelcu :
If I understand correctly :
There are two different references (A.d in the dict of the class A and
z.d in the dict of the object z)
> class A(object):
>d = 50
>def __init__(self):
> print "Hello"
>
> >>> z = A()
> >>> A.d
> 50
> >>> z.d
> 50
> 1) Why ?? d is not an object variable but a class variable !!!
Yes which means (definition of a class variable) that it's part of
every class and instance of the class.
>
Hi,
I am a little bit confuse about class variable & object variable (Python
2.4).
I have:
class A(object):
d = 50
def __init__(self):
print "Hello"
>>> z = A()
Hello
>>> A.d
50
(it's nice)
>>> z.d
50
(°)
1) Why ?? d is not an object variable but a class variable !!! For the