Привет Mike! 17 мая 2005 в 16:38, Mike Meyer в своем письме к Alexander Zatvornitskiy писал: MM> Actually, it is shared - but only for reference. If you assign to it, MM> you'll create an instance variable of the same name. As Peter MM> explained, if you remove the instance variable, the class variable MM> becomes visible again. Try this: py>> class C: MM> ... q = [] MM> ... py>> c1 = C() py>> c2 = C() py>> c3 = C() py>> c1.q.append(1) py>> c2.q.append(2) py>> c3.q.append(3) py>> c1.q, c2.q, c3.q MM> ([1, 2, 3], [1, 2, 3], [1, 2, 3]) py>>
It's true. Surpise! Hence, every "non-static in c++-meaning" variable must be initialized in constructor. It seems strange for me. Thank you for explanation! Alexander, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list