On 1/8/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 10:25 AM 1/8/2007 -0600, Collin Winter wrote: > >On 1/8/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > >>At 09:14 PM 1/7/2007 -0600, Collin Winter wrote: > >> >The transformation is as Phillip outlined above, with extra logic to > >> >handle the case where e is a tuple or list. > >> > >>In the tuple or list case, there's no need to reset the variables, because > >>then the traceback won't be present any more; the exception object will > >>have been discarded after unpacking. > > > >Ah, good point. I'll update the patch to strip out that extra code. > > Hm... what happens with things like: > > except Exception, x[y]: > > and > > except Exception, x(y).z: > > Are these currently allowed? Should they be allowed? And should we clear > them?
They are currently allowed, and they are currently being cleared. > My inclination is to say that we should only clear in the simple local > variable case, as anything more advanced is up to the author to sort out. > > Actually, I think we should probably just define the syntax in Py3K as: > > except <expr> [as <name>]: > FWIW, I wasn't aware that things like "except T, (a, b, c):" were possible until I started work on this patch; I thought <name> was all you _could_ use. Collin Winter _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
