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/079336.html below:

[Python-Dev] Adding start to enumerate()

[Python-Dev] Adding start to enumerate() [Python-Dev] Adding start to enumerate()Steven D'Aprano steve at pearwood.info
Mon May 12 01:42:45 CEST 2008
On Mon, 12 May 2008 08:20:51 am Georg Brandl wrote:
> I believe the following is a common use-case for enumerate()
> (at least, I've used it quite some times):
>
> for lineno, line in enumerate(fileobject):
>      ...
>
> For this, it would be nice to have a start parameter for enumerate().

Why would it be nice? What would you use it for?

The only thing I can think of is printing lines with line numbers, and 
starting those line numbers at one instead of zero. If that's the only 
use-case, should it require built-in support?



-- 
Steven
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