Dot-comma, anyone? (Re: zip or marry etc)

Greg Ewing see at my.signature
Thu Jul 20 23:20:19 EDT 2000


Matthias wrote:
> 
>  for x,y,z in a&b&c:

But a&b&c parses as (a&b)&c, which is not what
we want at all!

What we're talking about can't be done by overloading
a binary operator, because it's not binary -- it's
n-ary, where n is the number of lists we're
zipping.

Furthermore, there's no reason why a, b and c
couldn't be instances of classes which implement
& in such a way that the result is a valid
sequence type.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list