Message45150
Logged In: YES
user_id=4771
We may not need two levels of nested anonymous functions. It seems to me that the following equivalent code would do, because it captures the variable in an argument instead of via nested scopes:
x = 1
def __gen(x):
for i in range(10):
yield x
g = __gen(x)
I don't know though if this is easy to implement in compile.c. Alternatively:
x = 1
def __gen(x=x):
for i in range(10):
yield x
g = __gen()
|
|
Date |
User |
Action |
Args |
2007-08-23 15:31:35 | admin | link | issue872326 messages |
2007-08-23 15:31:35 | admin | create | |
|