This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients aronacher, catalin.iacob, draghuram, eric.araujo, ethan.furman, ezio.melotti, mrabarnett, ncoghlan, pitrou, poke, rhettinger, steven.daprano
Date 2012-01-27.05:26:36
SpamBayes Score 1.9090245e-09
Marked as misclassified No
Message-id <4F223581.9090804@pearwood.info>
In-reply-to <1327629303.27.0.324384792427.issue6210@psf.upfronthosting.co.za>
Content
Nick Coghlan wrote:
> Nick Coghlan <ncoghlan@gmail.com> added the comment:
> 
> 1. Any syntax change requires a PEP (and, IMO, any such PEP for this issue
> should get rejected: I don't consider this an important enough feature to
> deserve dedicated syntax. Others disagree, which is one of the reasons why
> a PEP is needed. The other, more important, reason is to ensure the new
> syntax is spec'ed out clearly and incorporated into the language reference
> for the benefit of other implementations in the event that it *does* get
> approved)

This already has a PEP. This is an *explicitly* unresolved issue from the
original PEP that introduced exception chaining in the first place.

http://www.python.org/dev/peps/pep-3134/

I quote:

Open Issue: Suppressing Context

     As written, 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.

With Ethan's patch, no new syntax is required. Since you can already say:

raise exception from another_exception

the syntax remains unchanged. There is an API change: currently 
another_exception must inherit from BaseException, with the patch it may also 
be None, but that doesn't change the syntax.
History
Date User Action Args
2012-01-27 05:26:37steven.dapranosetrecipients: + steven.daprano, rhettinger, ncoghlan, pitrou, draghuram, aronacher, ezio.melotti, eric.araujo, mrabarnett, poke, ethan.furman, catalin.iacob
2012-01-27 05:26:36steven.dapranolinkissue6210 messages
2012-01-27 05:26:36steven.dapranocreate