Hi,

I initially thought that generator/generator expression is cool(sort of
like the lazy evaluation in Haskell) until I notice this side effect.

>>>a=(x for x in range(2))
>>>list(a)
[1,2]
>>>list(a)
[]

Would this make generator/generator expression's usage pretty limited ?
As when the program/system goes beyond a single module, this behaviour
can cause subtle bugs ?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to