by martin_k · 14y ago · 0 comments
Edit: Perhaps, to clear things up more, about where the value 7 went- your snippet can be expressed without using lambdas as
>>> def g(x):
... return 7
...
>>> def f():
... v = (yield)
... g(v)
...
>>> list(f())
[None]
Note that there's no return before g(v) because generators (at least in 2.7) can only yield, not return a value. >> So that’s the only case I can think of where Python
>> completely throws away the value of a lambda function.