<p>The following test fails:</p>

<pre><code>#!/usr/bin/env python
def f(*args):
    """
    &gt;&gt;&gt; t = 1, -1
    &gt;&gt;&gt; f(*map(lambda i: lambda: i, t))
    [1, -1]
    &gt;&gt;&gt; f(*(lambda: i for i in t)) # -&gt; [-1, -1]
    [1, -1]
    &gt;&gt;&gt; f(*[lambda: i for i in t]) # -&gt; [-1, -1]
    [1, -1]
    """
    alist = [a() for a in args]
    print(alist)

if __name__ == '__main__':
    import doctest; doctest.testmod()
</code></pre>

<p>In other words:</p>

<pre><code>&gt;&gt;&gt; t = 1, -1
&gt;&gt;&gt; args = []
&gt;&gt;&gt; for i in t:
...   args.append(lambda: i)
...
&gt;&gt;&gt; map(lambda a: a(), args)
[-1, -1]
&gt;&gt;&gt; args = []
&gt;&gt;&gt; for i in t:
...   args.append((lambda i: lambda: i)(i))
...
&gt;&gt;&gt; map(lambda a: a(), args)
[1, -1]
&gt;&gt;&gt; args = []
&gt;&gt;&gt; for i in t:
...   args.append(lambda i=i: i)
...
&gt;&gt;&gt; map(lambda a: a(), args)
[1, -1]
</code></pre>

The lambda captures variables, not values, hence the code
```
```
lambda : i
```
```
will always return the value i is
currently
bound to in the closure.  By the time it gets called, this value has been set to -1.
To get what you want, you'll need to capture the actual binding at the time the lambda is created, by:
```
```
>>> f(*(lambda i=i: i for i in t)) # -> [-1, -1]
[1, -1]
>>> f(*[lambda i=i: i for i in t]) # -> [-1, -1]
[1, -1]
```
```