Message152063
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. |
|
Date |
User |
Action |
Args |
2012-01-27 05:26:37 | steven.daprano | set | recipients:
+ steven.daprano, rhettinger, ncoghlan, pitrou, draghuram, aronacher, ezio.melotti, eric.araujo, mrabarnett, poke, ethan.furman, catalin.iacob |
2012-01-27 05:26:36 | steven.daprano | link | issue6210 messages |
2012-01-27 05:26:36 | steven.daprano | create | |
|