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/006175.html below:

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

[Python-Dev] zip() and list-comprehension with commasBarry A. Warsaw bwarsaw@beopen.com
Tue, 11 Jul 2000 23:44:47 -0400 (EDT)
>>>>> "KY" == Ka-Ping Yee <pingster@ilm.com> writes:


    KY> I like this idea.  This whole parallel iteration thing could
    KY> be solved with a single built-in and no syntax changes.

    KY>     for x, y in parallel([10, 20, 30], [1, 2]):

    KY> Or "zip", since you're zipping the lists together (i foresee
    KY> potential geometric or concurrency-related interpretations of
    KY> "parallel"):

Definitely +1 on concept.  The nice bit is that parallel() or zip()
can return objects that iterate efficiently.  -0 on zip(), +0 on
parallel(), +0 on making them builtins.

Alternatives (as Greg I think brought up): pairwise(), maybe zipper()
for zip() since it's more evocative.

-Barry



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