[Stackless] Exception passing patch
richard.m.tew at gmail.com
Thu Dec 3 06:45:06 CET 2009
2009/12/3 Kristján Valur Jónsson <kristjan at ccpgames.com>:
>> -----Original Message-----
>> From: Richard Tew [mailto:richard.m.tew at gmail.com]
>> Sent: 2. desember 2009 21:50
>> To: Peter Ingebretson
>> Cc: Kristján Valur Jónsson; stackless at stackless.com
>> Subject: Re: [Stackless] Exception passing patch
>> Ah well, if raising exceptions out of generators is valid, then I can
>> hardly object to the same being possible with channels. But I do not
>> think there is a reason to deprecate the old behaviour.
> Richard, you will notice that python's "raise" operator can take anything from 0 to three arguments.
> The first two can be:
> - class and instance of class
> - class and arguments (tuple, None, or any object)
> - instance and None
> The third, if given, is an associated traceback to extend
> No arguments will raise the current exception.
> How does it sound to have send_exception() emulate this three argument behaviour?
In any case, the patch looks good to me. If you want send_exception
changed to match raise, it's also fine by me.
More information about the Stackless