A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2008-October/082827.html below:

[Python-Dev] if-syntax for regular for-loops

[Python-Dev] if-syntax for regular for-loops [Python-Dev] if-syntax for regular for-loopsGreg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 4 01:34:10 CEST 2008
Vitor Bosshard wrote:
> 
>>On Fri, Oct 3, 2008 at 6:10 AM, Andreas Nilsson wrote:
>>Essentially, all that saves is a newline
>>or two, which, as I think has been generally accepted, tends to hurt
>>readability.
> 
> The exact same argument could be used for list comprehensions themselves.

No, an LC saves more than newlines -- it saves the code
to set up and append to a list. This is a substantial
improvement when this code would otherwise swamp the
essentials of what's being done.

This doesn't apply to a plain for-loop that's not
building a list.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4