[Python-Dev] cpython (2.7): note Ellipsis syntax
Nick Coghlan
ncoghlan at gmail.com
Sun Jul 31 10:15:25 CEST 2011
On Sun, Jul 31, 2011 at 4:28 PM, Georg Brandl <g.brandl at gmx.net> wrote:
> (Also, there must have been some reason to make "..." available everywhere
> for Python 3.)
Not really - it just let us ditch some special casing in the
compilation toolchain that *restricted* it to being used in subscripts
(i.e. we were looking at the question from the "is there a good
rationale for keeping this arbitrary restriction?" angle).
Functionality wise, you could already write 'Ellipsis' everywhere you
would otherwise have written '...' and you still have to write ':' as
'slice(None)' outside the context of a subscript operation.
Although, as Raymond notes, it can make a nice substitute for 'pass'
as a placeholder statement, and can also be used as a placeholder
expression.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list