On Tue, 11 Jul 2000, Ka-Ping Yee wrote: > On Tue, 11 Jul 2000, Paul Prescod wrote: > > > > Parallel iteration and list comprehensions are separate. I do prefer a > > parallel() (merge?) builtin to the semicolon syntax, myself. You could > > even define xparallel which is the lazy version (as in xrange). > > I like this idea. This whole parallel iteration thing could be solved > with a single built-in and no syntax changes. > > for x, y in parallel([10, 20, 30], [1, 2]): > > Or "zip", since you're zipping the lists together (i foresee potential > geometric or concurrency-related interpretations of "parallel"): +1 on prefering a builtin to a syntax change > for x, y in zip([10, 20, 30], [1, 2]): > > [(x, y+z), for (x, y) in zip((1, 2, 3, 4, 5, 6), "abc"), for z in "de"] +1 on that too...really clear -- Moshe Zadka <moshez@math.huji.ac.il> There is no GOD but Python, and HTTP is its prophet. http://advogato.org/person/moshez
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