It's not often I get a chance to correct Danny, but....

On Wed, 11 May 2005, Danny Yoo wrote:

>      map(lambda x: x^2, [1, 2, 3])
> 
>      [x^2 for x in [1, 2, 3]]
> then we're really saying something like this:
> 
>      [1,     2,     3]
>       |      |      |
>       |      |      |  map()
>       |      |      |
>       V      V      V
>      [1,     4,     9]

You probably don't want to invoke a bitwise exclusive-or here!

I think Danny meant:

  map(lambda x: x**2, [1, 2, 3])
  [x**2 for x in [1, 2, 3]]



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to