[Tutor] Ellipsis syntax

John Fouhy john at fouhy.net
Tue Nov 22 03:27:14 CET 2005


On 22/11/05, Hugo González Monteverde <hugonz-lists at h-lab.net> wrote:
> I have looked for any references of ellipsis '...' syntax for Python
> slices, but I keep finding the same BNF grammar in the
> LanguageRreference. Is there any page with examples on how to do this,
> or is this just very obscure?

Wow, funky.

I found some links from when someone asked this last year:

Main thread:
http://mail.python.org/pipermail/python-list/2004-November/thread.html#252683

Good posts:
http://mail.python.org/pipermail/python-list/2004-November/252614.html
http://mail.python.org/pipermail/python-list/2004-November/252616.html
http://mail.python.org/pipermail/python-list/2004-November/252622.html

It seems that python slicing syntax supports slices like a[1, 2, ...],
but no builtin types (list, string, tuple, etc) are capable of
decoding slices like that.  But you can implement your own classes if
you want (say, if you want to implement multidimensional arrays).

--
John.


More information about the Tutor mailing list