Message45170
Logged In: YES
user_id=671362
What about this code?
In the currently implementation, loop variables inside a list
comprehension is not visible outside if you use it inside a
generator expression.
For example:
>>> (a*b for a in [b for b in range(5)])
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'b' is not defined
Its list comprehension counterpart is:
>>> [a*b for a in [b for b in range(5)]]
[0, 4, 8, 12, 16] |
|
Date |
User |
Action |
Args |
2007-08-23 15:31:37 | admin | link | issue872326 messages |
2007-08-23 15:31:37 | admin | create | |
|