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

Nick Coghlan ncoghlan at gmail.com
Fri Feb 3 05:02:36 CET 2012


On Fri, Feb 3, 2012 at 1:34 PM, Tim Delaney <timothy.c.delaney at gmail.com> wrote:
> ? I kinda like the second - it feels more self-descriptive to me than "from
> Ellipsis" - but there's the counter-argument that it could look like noise,
> and I think would require a grammar change to allow it there.

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

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*.

As I noted earlier, supporting Ellipsis in the "raise X from Y" syntax
shouldn't require a code change in Ethan's implementation, just a few
additional tests to ensure it works as expected.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list