Guido van Rossum <gu...@python.org> added the comment:

All examples so far (*) have to do with our inability to have properly nested 
blocks. If we did, I'd make the except clause a block, and I'd issue a syntax 
warning or error if a nested block shadowed a variable referenced outside it. 
Ditto for generator expressions and comprehensions.

As long as we don't have nested blocks, I think it's okay to see the limitation 
on (implicit or explicit) "del" of a cell variable as a compiler deficiency and 
fix that deficiency.

__________
(*) However there's also this example:

>>> def f():
...  try: 1/0
...  except Exception as a:
...   def g(): return a
...   return g
... 
SyntaxError: can not delete variable 'a' referenced in nested scope
>>>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4617>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to