[Python-Dev] PEP 409 update [was: PEP 409 - final?]

Ethan Furman ethan at stoneleaf.us
Fri Feb 3 18:29:25 CET 2012


Yury Selivanov wrote:
> While the example is valid, I doubt that it is in any sense 
> "common" case.

No it is a corner case.  Another way to spell it is:

try:
     try:
         raise IndexError()
     except:
         raise CustomError() from None
except CustomError as e:
     # nevermind, let's see the whole thing after all
     e.__cause__ = Ellipsis
     raise e

Ethan


More information about the Python-Dev mailing list