[Python-Dev] PEP 409 update [was: PEP 409 - final?]
Tim Delaney
timothy.c.delaney at gmail.com
Fri Feb 3 06:16:07 CET 2012
On 3 February 2012 15:02, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Both will be allowed - in 3.x, '...' is just an ordinary expression
> that means exactly the same thing as the builtin Ellipsis:
>
> >>> Ellipsis
> Ellipsis
> >>> ...
> Ellipsis
>
I'd totally forgotten that was the case in 3.x ... it's still not exactly
common to use Ellipsis/... directly except in extended slicing.
> Sane code almost certainly won't include *either* form, though. If
> you're reraising an exception, you should generally be leaving
> __cause__ and __context__ alone, and if you're raising a *new*
> exception, then __cause__ will already be Ellipsis by default - you
> only need to use "raise X from Y" to set it to something *else*.
>
Absolutely - I can't think of a reason to want to reraise an existing
exception while supressing any existing __cause__ in favour of __context__.
But I'm sure someone can.
Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120203/b710299d/attachment.html>
More information about the Python-Dev
mailing list