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

Phillip J. Eby pje at telecommunity.com
Sat Feb 10 18:02:17 CET 2007

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

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.

More information about the Python-3000 mailing list