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

Matthias matthias_w at my-deja.com
Fri Jul 21 08:26:37 EDT 2000


Greg Ewing <see at my.signature> wrote:
> 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!

this is not what i want, either
[1,2,3]&[4,5,6] == [(1,4),(2,5),(3,6)]
[1,2,3]&[4,5,6]&[7,8,9] == [((1,4),7),((2,4),8),((3,6),9)]
.... thinking hard :-) ....
[1,2,3]., [4,5,6] == [(1,4),(2,5),(3,6)]
[1,2,3]., [4,5,6]., [7,8,9] == [(1,4,7),(2,4,8),(3,6,9)]
so, ".," is an extension of the "," operator, ...
.... thinking harder ....

> 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.

very good point. I didn't think about that
Matthias


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list