[Python-Dev] PEP 409 and the stdlib

R. David Murray rdmurray at bitdance.com
Mon May 20 15:52:08 CEST 2013


On Mon, 20 May 2013 06:12:41 -0700, Ethan Furman <ethan at stoneleaf.us> wrote:
> As a quick reminder, PEP 409 allows this:
> 
>      try:
>          ...
>      except AnError:
>          raise SomeOtherError from None
> 
> so that if the exception is not caught, we get the traditional single exception traceback, instead of the new:
> 
>      During handling of the above exception, another exception occurred
> 
> 
> My question:
> 
> How do we go about putting this in the stdlib?  Is this one of the occasions where we don't do it unless we're modifying 
> a module already for some other reason?
> 
> For that matter, should we?
> 
> Pros:  Makes tracebacks much less confusing, especially coming from a library
> 
> Cons:  Could hide bugs unrelated to what is being caught and transformed

I'm pretty sure the answer is "almost never".

I think a case needs to be made for any place that seems like it would
actually improve things, because usually I don't think it will, in the
stdlib.

--David


More information about the Python-Dev mailing list