In this class:
class MyClass () :
foo = 1
@staticmethod
def bar () :
print MyClass.foo
Why do I need to qualify foo
with MyClass
? (otherwise I get NameError: global name 'foo' is not defined
.
Isn't foo
local to the class MyClass
?