On 3 February 2012 15:02, Nick Coghlan <ncogh...@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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to