Too many return-statements = bad style?
tjreedy at udel.edu
Wed Jul 14 23:53:57 CEST 2004
[snip 5 ways to process file with while loops]
"Michael Geary" <Mike at Geary.com> wrote in message
news:10fb934hkq76c97 at corp.supernews.com...
> File.open(...).each do |line|
> [ process line from file ]
I presume this is equivalent to Python's
for line in file(...):
while is the proper way in Python also. With iterators, for loops make
many awkward while loops obsolete.
Terry J. Reedy
More information about the Python-list