A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/006219.html below:

[Python-Dev] zip() and list-comprehension with commas

[Python-Dev] zip() and list-comprehension with commas [Python-Dev] zip() and list-comprehension with commasKa-Ping Yee ping@lfw.org
Wed, 12 Jul 2000 03:14:54 -0700 (PDT)
On Wed, 12 Jul 2000, Paul Prescod wrote:
> 
> The easy way to avoid the ambiguity is to dump the comma and use colons
> as Guido intended.
> 
> [for x in list1:
> 	 if x > 1:
> 		 for y in list2:
> 			 if y > 2:
> 				(x,y)]

Does indentation matter, and are you proposing blocks of
"real" code in there?  I suspect that writing it this way
is going to tempt people to include more code, maybe expect
to be able to write "else" clauses, put in "break", etc.

I think if you do it this way, the above is so close to how
you'd write it without list comprehensions that it largely
eliminates the succinctness that motivated list comprehensions
in the first place.


-- ?!ng




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