Consider the following code:
def f (a):
return 1
def g (a):
return 2
[lambda a: i(a) for i in (f,g)][0](0)
The result is 2. Where it should clearly be 1! I would expect this code to execute as follows. Create a list. Copy the function f into the first index. Copy g into the second index. Fin.
Why does this execute the way it does?!