You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for filing this issue, Anders! Interesting ...
Would you suggest that futurize work around this problem by changing all map(f, seq) calls into list((f(item) for item in seq)) instead of [f(item) for item in seq]? This would work, but it seems a little drastic ... The other option would be a note in the docs warning about a potential change in the semantics due to Py2's leakage of list-comprehension temporary variables ...
I personally would go the drastic way (in fact I have started modifying all my python2 code accordingly), I do not read documentation close enough to catch this :-(, especially not if not aware of the problem beforehand.
Before futurizing, the following:
gives the following output:
while the futurized code:
gives the following output:
See http://python-history.blogspot.se/2010/06/from-list-comprehensions-to-generator.html for further explanation.
The text was updated successfully, but these errors were encountered: