PEP-315 ("do" loop)
Ville Vainio
ville at spammers.com
Thu Feb 19 14:55:54 EST 2004
>>>>> "Josiah" == Josiah Carlson <jcarlson at nospam.uci.edu> writes:
Josiah> Personally, I find altering the syntax of while, or adding
Josiah> the 'do' to be a wart. I've never had problems
Josiah> understanding or writing code like the following; while 1:
Josiah> #setup if <condition>: break #body
Josiah> If I had a vote, I'd be -1 on PEP 315.
Amen to that! I think this is only a matter of education. People
should be told that 'while 1' construct is a good, simple, pythonic
way to do the thing. They are often prejudiced, thinking that there is
something 'wrong' with the construct. Hearing that it's ok to do
things this way can actually be very liberating: there is no reason to
feel guilty, and they will quite soon learn to appreciate how natural
and versatile the construct is.
Naming it 'loop' would drive the point even further, of course.
--
Ville Vainio http://tinyurl.com/2prnb
More information about the Python-list
mailing list