PEP-0315--Enhanced While Loop: An idea for an alternative syntax

Ville Vainio ville at spammers.com
Thu Feb 19 20:42:52 CET 2004


>>>>> "Andrew" == Andrew Koenig <ark at acm.org> writes:

    Andrew> Any loop that is currently written in the form

    Andrew> while True: <statements> if condition: break more
    Andrew> statements

Why not just make a new keyword, 'loop', an alias of "while 1"?

Usually it seems that the 'get data to process' is done immediately
after "while 1", and the break immediately after that. It's a good
construct, easy to understand and easy to type (if you use 'while 1'
instead of 'while True', that is - 'while True' seems like a rather
pointless excercise to me).

Also, the proposed construct doesn't IMVHO seem less cryptic at all -
exactly the opposite, in fact.

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list