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

I don't think this has much to do with try/except.  That it works in 2.6
but not in 3.0 isn't a big deal; the semantics of variables used in
except clauses has changed dramatically.

It has to do with deletion of a variable that's held in a cell for
reference by an inner function, like this:

def outer():
  x = 0
  def inner(): return x
  del x  # SyntaxError

I suspect (but do not know for sure) that the reason this is considered
a SyntaxError is that the implementer of cells punted on the 'del'
implementation and inserted a SyntaxError instead.  (You can tell it's a
pass-two SyntaxError because it doesn't mention a line number.)

I think it's fine to fix this in 2.7 and 3.1, but I don't see it as a
priority given that this has always been this way (and despite that it
now affects try/except).  It will probably require a new opcode.

I don't see a reason to declare this a release blocker just because the
try/except code is affected, and I don't think try/except needs to be
changed to avoid this.

----------
assignee: gvanrossum -> 
priority: release blocker -> normal

_______________________________________
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