PEP 315: Enhanced While Loop

Gareth McCaughan Gareth.McCaughan at pobox.com
Tue May 6 14:58:20 EDT 2003


Charles Hixson wrote:

> Perhaps this should be done in a more general way.  Just create a block 
> keyword, do: is fine.
> 
> what this keyword does is introduce a logical level of grouping (i.e., 
> the code underneath it is indented once.)  It is strictly equivalent to
> "if True:"
> 
> Whether this would be worthwhile or not, I don't know, but it seems both 
> simple and sufficient to satisfy what I understand of your request.
> I.e., it would allow one to write
> do:
>     """ some code """
> while(test):
>     """ some more code """

It would allow you to write that, but it wouldn't
mean what WIC wants it to. In his proposal, the
loop body contains both suites; in yours, it contains
only the second.

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
.sig under construc




More information about the Python-list mailing list