I'm typing in an interactive mode the following code:
class A:
a=42
def foo():
nonlocal a
but I've a SyntaxError: no binding for nonlocal 'a' found
. But I'm expected that the result of resolution nonlocal a
will be 42, because the nearest enclosing scope for this method is a class block.