Le Wednesday 13 August 2008 21:04:30 Rhamphoryncus, vous avez écrit : > class X(object): > foo = 42 > > def bar(self): > print foo > print self.foo > X.foo = 7
Yes this is a problem, function could not bind their free vars to the class namespace without introducing a subtle incompatibility with actual code. This is exactly this case which would be a problem (your example raise an error and is not exactly a "running code"): G = 1 class A(object) : G = 0 def f(self) : return G -- _____________ Maric Michaud -- http://mail.python.org/mailman/listinfo/python-list