A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-January/085309.html below:

Add a "while" clause to generator expressions

[Python-Dev] PEP 3142: Add a "while" clause to generator expressions [Python-Dev] PEP 3142: Add a "while" clause to generator expressionsEric Smith eric at trueblade.com
Thu Jan 22 10:06:24 CET 2009
Terry Reedy wrote:
> Cameron Simpson wrote:
>>
>> Back at uni we had to implement a small language in our compilers class
>> and the lecturer had specified a proper generic while loop, thus:
>>
>>   loop:
>>     suite
>>   while invariant
>>     suite
>>   endloop
> 
> In Python, that is spelled
> 
> while True:
>   suite
>   if not invariant: break
>   suite

Indeed. This is the well known "loop and a half" problem.

Eric.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4