why no "do : until"?

Aahz Maruch aahz at panix.com
Mon Jan 8 16:08:34 EST 2001


In article <mailman.978660367.22251.python-list at python.org>,
Tim Peters <tim.one at home.com> wrote:
>
>A study I did at the time said that about 15% of all "for" loops in Python
>code were of the form
>
>    for i in range(len(a)):
>
>and that's both an obscure and inefficient way to spell the underlying idea.

Huh.  I've always tended to do this instead:

i = 0
for tmp in a:
    ...
    i += 1
-- 
                      --- Aahz (Copyright 2001 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Sometimes, you're not just out of left field, you're coming in all the
way from outer space.  --Aahz



More information about the Python-list mailing list