On 4/19/2012 1:15 PM, Kiuhnm wrote:
A with statement is not at the module level only if it appears inside a function definition or a class definition.
This is true, I believe, of all statements.
Am I forgetting something?
Comprehensions (in Py3) and lambda expressions also introduce new local scopes -- because they are abbreviated def statements. But they cannot contain statements, only expressions, in that new scope.
-- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list