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

Guido van Rossum guido at python.org
Sat Feb 10 18:09:45 CET 2007


WFM.

On 2/10/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 10:52 PM 2/9/2007 -0600, Collin Winter wrote:
> >On 2/9/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> >>At 05:03 PM 2/9/2007 -0800, Guido van Rossum wrote:
> >> >On 2/9/07, Collin Winter <collinw at gmail.com> wrote:
> >> > > sys.exc_info() will be kept, while the sys.exc_{type,value,traceback}
> >> > > attributes will be dropped.
> >> >
> >> >I understand why, but that doesn't make me uncomfortable with keeping
> >> >it. Maybe in "3.0 compatibility mode" 2.6 could attach tracebacks to
> >> >exception objects so we could be weened off it in 2.6?
> >>
> >>I notice that neither PEP addresses PEP 343 compatibility.  Do we plan to
> >>make __exit__() only get one argument?  Right now the protocol demands all
> >>three.  I suppose we could pass one argument in 3.0, and if you want to
> >>support 2.6 you would have to add default arguments.  Such code would be
> >>ugly as sin, but workable.
> >
> >Couldn't __exit__() be passed (type(e), e, e.__traceback__) instead of
> >*sys.exc_info()?
>
> Sure, but *why*?  After all, we're changing gen.throw() in the same way.
>
> My thought is, 2.6 would pass all three arguments, 3.0 just one.
>
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list