Dot product?

Magnus L. Hetland mlh at vier.idi.ntnu.no
Mon Dec 13 17:19:23 EST 1999


Greg Ewing <greg.ewing at compaq.com> writes:

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

That was my point exactly - if list1 and list2 were known to be lists,
the "and" would be a safe delimiter, just as it is in its first
occurrence.

> > 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 :-(

Oh, well... At least its current meaning is quite elegant :)

> 
> Greg

--

  Magnus          Echelon jamming noise:
  Lie             FBI CIA NSA Handgun Assault Bomb Drug Terrorism
  Hetland         Special Forces Delta Force AK47 Hillary Clinton 



More information about the Python-list mailing list