[Python-3000] sys.exc_info()

Guido van Rossum guido at python.org
Tue Jun 3 05:59:02 CEST 2008


On Mon, Jun 2, 2008 at 8:56 PM, Adam Olsen <rhamph at gmail.com> wrote:
> On Mon, Jun 2, 2008 at 9:46 PM, Guido van Rossum <guido at python.org> wrote:
>> On Mon, Jun 2, 2008 at 8:16 PM, Adam Olsen <rhamph at gmail.com> wrote:
>>> On Mon, Jun 2, 2008 at 8:56 PM, Fred Drake <fdrake at acm.org> wrote:
>>>> On May 31, 2008, at 6:42 PM, Tim Delaney wrote:
>>>>>
>>>>> This reminds me of something I've thought a few times - maybe the tuple
>>>>> returned from sys.exc_info() should be a named tuple.
>>>>
>>>> +1
>>>
>>> It should be replaced with a function that returns only the value -
>>> type and traceback are both redundant now.  I don't think anything's
>>> been proposed yet though.
>>
>> Since I expect that in a while we will be able to deprecate
>> sys.exc_info() and later kill it, I would rather not meddle with it
>> now. There is tons of code out there that does fairly obscure things
>> with it, and keeping that code happy is higher on my list than
>> cleaning up an API that's eventually doomed.
>>
>> I'm similarly underwhelmed by the idea having it return a named tuple.
>> I personally don't have any trouble keeping three values apart, so I
>> don't think it adds much.
>
> So keep the old sys.exc_info() (at least for a few more releases) and
> add a new function that only returns the value?  Just need to find a
> name we can be happy with for a long time.. maybe
> sys.exception_block()?

Actually I think we won't  need that function once we're used to just
passing exception instances around.

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


More information about the Python-3000 mailing list