A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-April/044381.html below:

[Python-Dev] iter.index()

[Python-Dev] iter.index() [Python-Dev] iter.index()Raymond Hettinger python at rcn.com
Sun Apr 18 22:37:28 EDT 2004
[Christian Stork]
> I wanted to do something like
> 
>     i = itertools.chain(list1, list2).index(elem)

I'm curious about what application needed to do this.


> If I use the operator module it works just fine.
> 
>     i = operator.indexOf(itertools.chain(list1, list2), elem)

Nice solution.  It is general purpose, self-documenting, and efficient.



Raymond Hettinger


#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################

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