Op 02-10-16 om 07:59 schreef Rustom Mody:
>
> You are explaining the mechanism behind the bug. Thanks. The bug remains.
> My new car goes in reverse when I put it in first gear but only on full-moon 
> nights with the tank on reserve when the left light is blinking
> The engineer explains the interesting software bug in the new PCB.
> Interesting. But the bug remains
>
> Likewise here:
>
> [2 ** i for i in[1,2]] == [2**1, 2**2]
>
> yet this fails 
>
> [lambda x: x + i for i in [1,2]] == [lambda x:x+1, lambda x:x=2]
>
> is a bug for anyone including the OP of this thread
>
I once suggested that a list comprehension like [<exp> for i in <iterator>] 
should
be implemented as [(lambda i:<exp>)(i) for i in <iterator>].

As far a I can see, it would behave as expected in all cases.

-- 
Antoon


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to