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/2002-August/028361.html below:

[Python-Dev] A `cogen' module - an observation

[Python-Dev] A `cogen' module - an observationOren Tirosh oren-py-d@hishome.net
Tue, 27 Aug 2002 02:15:54 -0400
On Tue, Aug 27, 2002 at 06:14:51PM +1200, Greg Ewing wrote:
> > [f(x, y) for x in X for y in Y] 
> > 
> >   is equivalent to:
> > 
> > [f(x, y) for x, y in cartesian(X, Y)] 
> 
> Hmmm, in other words, cartesian() is a lazy version
> of zip().

Nope.

>>> zip([1, 2], ['a', 'b'])
[(1, 'a'), (2, 'b')]

>>> list(cartesian([1, 2], ['a', 'b']))
[(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b')]

	Oren



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