M
MetalOne
I don't like the syntax. I find the indentation counter-intuitive.
Push the "yucky" while 1: loop into a generator function,
and then use a regular "for" loop in the multiple places
you need to handle a file in this way:
Peter Maas said:The do block is no safeguard against copy errors because it's optional.
A comment saves the same purpose. Replace
do:
init()
while cond():
body()
by
# init while
init()
while cond():
body()
PEP-0315 shouldn't be added to Python.
Just for the record, that was actually written by François Pinard, not
me. Well worth quoting again, though, as it's a lovely example.
Paul said:No, you don't understand. The initialization is part of the loop.
That is, the replacement for the do loop is
while 1:
init()
if not cond: break
body()
Peter said:> do:
> <theBody>
> breakif <cond>
>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.