PEP 284, Integer for-loops
tim-dated-1016494087.c376d7 at catseye.net
Tue Mar 12 00:28:06 CET 2002
James_Althoff at i2.com writes:
> [Tim Legant]
> > So either Jason and I are significantly better than you and your
> > team at expressing ourselves naturally in Python <wink> or it's
> > the need to interface with Java that's forcing you to use integer
> > indices all the time. I'm betting big money on the latter.
> I'm happy to believe you all are excellent programmers versed in Pythonic
> ways. And I'm always happy to learn something new. So feel free to help
> me on this one.
Hmmm. Did you by any chance miss my <wink>?
My intent was to provide a supporting data point to your hypothesis
that the real issue is interfacing with Java. With Python as it
exists today, I am unaware of any good solutions.
[snip description of nasty problem...]
> Perhaps you could give some ideas on approaches that would be more
Well, like I was trying to convey in my original message, I think
you're stuck. Tim Peters actually came up with something a little
better, but I still think it's sad you have to write all kinds of
wrappers just to get a reasonable looping syntax.
FWIW, I completely agree that [x]range is awkward and inelegant (and
necessary) in these sorts of cases. I'm also in full agreement with
better language support for more complex loops. I haven't been really
happy with either of the PEPs, but I sure understand the problem
they're trying to address.
More information about the Python-list