[Python-Dev] iter.index() (original) (raw)
Raymond Hettinger python at rcn.com
Sun Apr 18 22:37:28 EDT 2004
- Previous message: [Python-Dev] iter.index()
- Next message: [Python-Dev] iter.index()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[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
################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# #################################################################
- Previous message: [Python-Dev] iter.index()
- Next message: [Python-Dev] iter.index()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]