[Python-3000] Ellipsis Literal

Guido van Rossum guido at python.org
Thu Jan 24 20:32:24 CET 2008


On Jan 24, 2008 11:16 AM, Raymond Hettinger <python at rcn.com> wrote:
> [Raymond Hettinger]
> >> I missed the conversation on this one.
> >> Was there a use case or a reason to add this?
>
> [Robert Kern]
> > It was added for Numeric a long time ago.
>
> The ellipsis syntax has been around for a while.
> What is new is the Ellipsis literal in Py3.0.
> See snippets below.
>
> Raymond
>
>
> ------------------------------------
> Python 2.6a0 (trunk:59985:59987, Jan 15 2008, 12:54:09) [GCC 4.1.1 (Gentoo 4.1.1)] on linux2
> >>> ...
>  File "<stdin>", line 1
>    ...
>    ^
> SyntaxError: invalid syntax
>
> ------------------------------------
> Python 3.0a2+ (py3k:60204M, Jan 22 2008, 14:50:12) [GCC 4.1.1 (Gentoo 4.1.1)] on linux2
> >>> ...
> Ellipsis

Some folks thought it would be cute to be able to write incomplete
code like this:

class C:
  def meth(self): ...
  ...

and have it be syntactically correct.

PEP 3100 has the reference:
* ``...`` to become a general expression element [16]_ [done]
.. [16] python-3000 email
   http://mail.python.org/pipermail/python-3000/2006-April/000996.html


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list