> Hello Guido, > > I did a quick review of the stdlib, including the tests, to see which list > comprehensions could be replaced with generator expressions. Thought I admit > I am biased towards early binding, I ended up looking for cases with the > following properties: [...] Even if we switched to early binding, won't these issues still bite you with mutable values? E.g.: some_dict = {'x': 1, 'y': 2} iter1 = (some_dict.get(v, 3) for v in input1) some_dict['z'] = 5 iter2 = (some_dict.get(v, 7) for v in input2) It seems like it would be surprising (to me, anyway) if this gave a different result than: some_dict = {'x': 1, 'y': 2} iter1 = (some_dict.get(v, 3) for v in input1) some_dict = {'x': 1, 'y': 2, 'z': 5} iter2 = (some_dict.get(v, 7) for v in input2) -Edward
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4