[Python-Dev] Python-Dev Digest, Vol 104, Issue 79

Peter Harris pete.alex.harris at gmail.com
Thu Mar 22 12:26:49 CET 2012


>
> On 03/21/2012 07:39 PM, Huan Do wrote:

> > *Hi,

> >

> > I am a graduating Berkeley student that loves python and would like to

> > propose an enhancement to python. My proposal introduces a concept of

> > slicing generator. For instance, if one does x[:] it returns a list

> > which is a copy of x. Sometimes programmers would want to iterate over a

> > slice of x, but they do not like the overhead of constructing another

> > list. Instead we can create a similar operator that returns a generator.

> > My proposed syntax is x(:). The programmers are of course able to set
> lower, upper, and step size like the following.

-1 on the syntax

And have you looked at itertools.islice ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120322/83b972cf/attachment.html>


More information about the Python-Dev mailing list