Newbie scopes question
op73418 at mail.telepac.pt
Wed Feb 27 20:37:35 CET 2002
As far as i understand, a class statement opens a new scope.
In the following piece of code
attribute = "The outer class attribute"
print "Attribute not defined!"
local_var = "Local var of the outer function"
a = Outer()
What we get printed is
Local var of the outer function
Attribute not defined!
This means that function and class scopes behave differently as fas as
nesting goes. Could someone explain why is this?
More information about the Python-list