[Python-ideas] raise EXC from None (issue #6210)

Jan Kaliszewski zuo at chopin.edu.pl
Sat Oct 22 03:32:02 CEST 2011


Hello.

Some time ago I encountered the problem described in PEP 3134 as "Open
Issue: Suppressing Context" ("this PEP makes it impossible to suppress
'__context__', since setting exc.__context__ to None in an 'except' or
'finally' clause will only result in it being set again when exc is
raised.").

An idea that then appeared in my brain was:

    raise SomeException(some, arguments) from None

...and I see the same idea has been proposed by Patrick Westerhoff here:
http://bugs.python.org/issue6210

I am +10, as I feel that's intuitive, elegant and status-quo-consistent.

And what do you think?

Cheers.
*j




More information about the Python-ideas mailing list