A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079399.html below:

[Python-Dev] Adding start to enumerate()

[Python-Dev] Adding start to enumerate() [Python-Dev] Adding start to enumerate()Guido van Rossum guido at python.org
Tue May 13 21:01:20 CEST 2008
On Tue, May 13, 2008 at 11:53 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Wed, 14 May 2008 12:25:01 am Guido van Rossum wrote:
>
>  > However I see no use for skipping items
>  > from the start,
>
>  You've never had to deal with data where the first N items were special
>  in some way? e.g. skipping over a header line in a file?

Of course I have. But never in the argument to enumerate().

[...]

>  > and if that use case ever came up, passing a slice to
>  > enumerate() would be the appropriate thing to do.
>
>  While slices are wonderfully useful things, they aren't panaceas.
>  They're not so useful with iterators, and they make a copy of the data,
>  which can be problematic if there's a *lot* of it.

That's why we have itertools.islice().

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4