why no "do : until"?

Norman Shelley (rrdn60) rrdn60 at email.sps.mot.com
Fri Jan 5 11:03:55 EST 2001


So what has kept this proposal from seeing the light of day?
It appears from your description that this would provide a nice speed increase.

BTW, have you ever looked at fscript?
http://csam.sps.mot.com/
http://www.fscript.org./news.htm
http://www.fscript.org./HighLevelOOP.pdf

It appears to nicely marry Relational (its nice method of arbitrary queries
without the OO nastiness of traversing) with OO.
It would seem that Numeric.py might be a close starting point to
designing/implementing Fscript's ideas in Python.


Tim Peters wrote:
...

> My own years-old suggestion for a "for" enhancement is the "indexing"
> proposal, an optional clause on "for":
>
>     for i indexing a:
>     for i indexing x in a:
>
> 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.
> As an implementer, it also repels me <0.6 wink>:  Python *always* constructs
> an integer index under the covers, and what "for i in range(len(a))" really
> does is build a list of the integers 0, 1, 2, ..., len(a)-1; then the for
> loop mechanism generates the same integers one at a time all by itself; and
> then it passes each in turn to list.__getitem__(), all in order to get back
> the same integers it passes!  One of the Missing Pythonic Theses is "where
> the implementation is absurd, Guido was too Spartan" <wink>.
>
> it's-enough-that-"while-1"-keeps-testing-the-truth-of-"1"-ly y'rs
>     - tim





More information about the Python-list mailing list