What a curious assignment.

Neil.Jin at gmail.com Neil.Jin at gmail.com
Wed Nov 23 05:43:52 CET 2005


[test 1]
>>> class A:
...    i = 1
...
>>> a = A()
>>> A.i
1
>>> a.i
1
>>> A.i = 2
>>> A.i
2
>>> a.i
2
>>>

[test2]
>>> class A:
...    i = 1
...
>>> a = A()
>>> A.i
1
>>> a.i
1
>>> a.i = 2
>>> A.i
1
>>> a.i
2
>>>

Is there somthing wrong????




More information about the Python-list mailing list