Dot product?

Greg Ewing greg.ewing at compaq.com
Mon Dec 13 08:17:34 EST 1999


"Magnus L. Hetland" wrote:
> 
> And something like
> 
>   for x and y in list1 and list2:
> 
> is ruled out because - list1 and list2 may be arbitrary expressions
> resulting in lists or tuples? (Am I right?)

It's more because "list1 and list2" is already a single
expression which means "apply the 'and' operator to list1 
and list2".

> 
> And is
> 
>   for x,y in list1, list2:
> 
> ruled out because of anything except aesthetic preference?

Yes. You're already allowed a comma-separated list of
target variables, in which case unpacking occurs.

> (In that
> case, I would like to state my preference as being in favour of the
> latter, due to its consitency ;)

I would have preferred it too, but it's already taken :-(

Greg



More information about the Python-list mailing list