[Python-Dev] Lockstep iteration - eureka! (original) (raw)
Ka-Ping Yee ping@lfw.org
Wed, 9 Aug 2000 15:06:15 -0700 (PDT)
- Previous message: [Python-Dev] iterators
- Next message: [Python-Dev] Lockstep iteration - eureka!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 9 Aug 2000, Guido van Rossum wrote:
I forget what indices() was -- is it the moreal equivalent of keys()?
Yes, it's range(len(s)).
If irange(s) is zip(range(len(s)), s), I see how that's a bit unwieldy. In the past there were syntax proposals, e.g. ``for i indexing s''. Maybe you and Just can draft a PEP?
In the same vein as zip(), i think it's much easier to just toss in a couple of built-ins than try to settle on a new syntax. (I already uploaded a patch to add indices() and irange() to the built-ins, immediately after i posted my first message on this thread.)
Surely a PEP isn't required for a couple of built-in functions that are simple and well understood? You can just call thumbs-up or thumbs-down and be done with it.
-- ?!ng
"All models are wrong; some models are useful." -- George Box
- Previous message: [Python-Dev] iterators
- Next message: [Python-Dev] Lockstep iteration - eureka!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]