Message79228
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. |
|
Date |
User |
Action |
Args |
2009-01-06 05:01:46 | gvanrossum | set | recipients:
+ gvanrossum, jhylton, rhettinger, terry.reedy, pje, amaury.forgeotdarc, benjamin.peterson |
2009-01-06 05:01:45 | gvanrossum | set | messageid: <1231218105.65.0.396713191476.issue4617@psf.upfronthosting.co.za> |
2009-01-06 05:01:44 | gvanrossum | link | issue4617 messages |
2009-01-06 05:01:44 | gvanrossum | create | |
|