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/2004-July/045797.html below:

[Python-Dev] PEP 276 (simple iterator for ints)

[Python-Dev] PEP 276 (simple iterator for ints) [Python-Dev] PEP 276 (simple iterator for ints)Nick Coghlan ncoghlan at iinet.net.au
Thu Jul 1 00:24:08 EDT 2004
Greg Ewing wrote:

> "Chermside, Michael" <mchermside at ingdirect.com>:
> 
> 
>>    >>> for i in len(myList):
>>    ...     doSomethingWithIndexes(i)
>>
>>is simple and elegant.
> 
> 
> IMO it would be clearer, and equally elegant, to write
> this as something like
> 
>   for i in indices(myList):
>     ...
> 
> which is easily accomplished with the aid of a suitable
> definition for indices(). No language changes needed.

And I believe most of those use cases are better covered by enumerate() 
anyway.

Interesting that in the course of this discussion I've gone from 'nice 
idea' to 'no way!'

Cheers,
Nick.

-- 
Nick Coghlan               |     Brisbane, Australia
Email: ncoghlan at email.com  | Mobile: +61 409 573 268

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