[Python-3000] Pre-peps on raise and except changes (was: Warning for 2.6 and greater)

Collin Winter collinw at gmail.com
Sat Feb 10 01:09:45 CET 2007

On 2/9/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 02:57 PM 2/9/2007 -0800, Guido van Rossum wrote:
> > > On 2/9/07, Guido van Rossum <guido at python.org> wrote:
> > > > I agree that this API is better. If it's not in PEP 344 it should be
> > added.
> > >
> > > Should this be added to PEP 344 or 3109? That is, do you want to see
> > > it before Python 3?
> >
> >I think storing the traceback in the exception is a 3.0 feature, since
> >it depends on the effective 'del e' at the end of the except clause
> >for avoiding most cycles.
> We would then have to have a Python 3.0 API to fetch the traceback,
> otherwise there's no way to write code that works in both 2.6 and 3.0 and
> gets a traceback.  Did we decide to keep sys.exc_info()?  If so, then that
> would presumably work.

sys.exc_info() will be kept, while the sys.exc_{type,value,traceback}
attributes will be dropped.

As an aside, should sys.exc_clear() be added to the to-drop list? Is
there still a need for it given Python 3's exception cleanup

Collin Winter

More information about the Python-3000 mailing list