Re: [Python-Dev] Closures / Python Scopes
On 11/12/2010 3:08 PM, Hatem Nassrat wrote: A colleague of mine came across something anecdotal when working with lambdas, it is expressed by the following code snippet. In [1]: def a(): ...: for i in range(10): ...: def b(): ...: return i ...:
[Python-Dev] Closures / Python Scopes
A colleague of mine came across something anecdotal when working with lambdas, it is expressed by the following code snippet. In [1]: def a(): ...: for i in range(10): ...: def b(): ...: return i ...: yield b ...: ...: In [2]: func