[Python-Dev] PEP 3142: Add a "while" clause to generator expressions

Tres Seaver tseaver at palladion.com
Wed Jan 21 20:02:55 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vitor Bosshard wrote:

>> Some also allow for an "until" keyword.  I'm not suggesting that we
>> need to do this in Python; it's just interesting to note that there is
>> some precedent for this approach.
>>
> 
> Well, you could propose changing the for loop syntax (and by
> extension comprehensions and generators). It's a much more radical proposal, but
> it does keep consistency across the board, which is one of the major
> flaws of the PEP in its current form.
> 
> BTW, there is already an "until" keyword in python, it's called "while not" ;)

'until' is used at least in some languages (Pascal, Modula*, maybe Ada?)
for a "terminate at bottom" loop (one guaranteed to run at least once):
 in such cases, the predicate has the negative sense.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJd3Ff+gerLs4ltQ4RAuOQAJ47EA8Cf1KPMdNiZTBiJqweiUNZBgCgsVrc
38fgphB+hjdnTblAQT8Q5tA=
=SeEn
-----END PGP SIGNATURE-----



More information about the Python-Dev mailing list