enumerate improvement proposal

Fredrik Lundh fredrik at pythonware.com
Sun Oct 29 07:19:55 EST 2006


James Stroud wrote:

> def enumerate(itrbl, start=0, step=1):
>    i = start
>    for it in itrbl:
>      yield (i, it)
>      i += step

that's spelled

     izip(count(start), sequence)

in today's Python.

 > def in_interval(test, bounds, first=1, reverse=False):

why is it this function's job to add an offset to the actual sequence index?

</F>




More information about the Python-list mailing list