On Sat, 30 Mar 2013 08:24:00 +1100, Chris Angelico wrote: > On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry <sambez...@hotmail.co.uk> > wrote: >> class test() >> s = 1 >> >> def test1() >> global s >> s = 2
> That's not a global, that's a class variable. /me thwacks Chris with a halibut. Not only is "class variable" ambiguous, but Python uses different scoping rules for "variables" (name bindings) and attributes. I don't know what language first decided to conflate object attributes and variables -- I suspect Java -- but it is actively harmful terminology (in Python at least, if not in general) and whoever invented it is bad and should feel bad. -- Steven -- http://mail.python.org/mailman/listinfo/python-list