(Finally getting back around to this) On 2/9/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: [snip] > Hm. Actually, that's not necessary. We could include .with_traceback(T) > in 2.6, and just have old-style except: clauses delete the traceback from > the returned objects. New-style except: clauses would work just as they > would in 3.0.
What do you mean by "new-style" and "old-style except: clauses"? Are "new-style" except clauses the ones spelled "except E as NAME" while "old-style" ones are spelled "except E, NAME"? > To summarize, in 2.6 we could support .with_traceback() and create > exception instances with traceback attributes, but the old-style except: > clauses could discard them to prevent cycles. Clear enough. > Raising an exception > instance with a __traceback__ attribute would get some special handling so > that it's equivalent to 3-argument raise in today's Python. Likewise, > generator.throw() would need the same special handling in 2.6. What happens in this case: e = Exception() e.__traceback__ = T1 raise Exception, e, T2 Which traceback takes precedence? My preference would be to raise an exception in this case. 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
