Martin v. Löwis added the comment:

Simplicity is in the eye of the beholder, yet... you need to remember the break 
when *writing* the code, so the loop might be more difficult to write (but 
then, I need to remember/lookup the function name and parameters for 
coalesce)... when reading the code, the break is already there, and easy to 
notice. With Nick's remark, it's even more obvious that it is difficult to 
write :-)

If an unknown (to the reader) function is used, reading the code becomes 
actually difficult, since the reader either needs to guess what the function 
does, or look it up.

Note that I'm not objecting the addition of the function (I'm neutral), just 
the claim that there are no simple alternatives. I'm neutral because it falls 
under the "not every two-line function needs to go into the standard library" 
rule; but then, if it is really popular, it helps readability if it is in the 
library (rather than duplicated by users).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18652>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to