repeat/while?

Russell Nelson nelson at crynwr.com
Thu May 3 21:20:38 CEST 2001


Is there any enthusiasm for repeat/while in Python?  It would replace the following ideom:

while 1:
    line = sys.stdin.readline()
    if not line: break
    pass  # handle line here

with this:

repeat:
    line = sys.stdin.readline()
while line:
    pass  # handle line here

Semantics are unchanged.  If Python had a goto, it could also be
expressed like this:

goto entrypoint
while line:
    pass  # handle line here
entrypoint:
    line = sys.stdin.readline()

Or should I write this up as a PEP?

-- 
-russ nelson will be speaking at http://www.osdn.com/conferences/handhelds/
Crynwr sells support for free software  | PGPok | Mailing lists should not set
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Reply-To: back to the list!
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX  | http://russnelson.com/rt.html



More information about the Python-list mailing list