Message161943
As Robert noted, the map() and filter() builtins in Python 3 are already lazy and there's no reason to expand the iterator protocol for this functionality.
Map and filter also have dedicated syntax in the form of comprehensions and generator expressions:
itr = (x for x in map(abs, range(10)) if x % 5 == 0)
Furthermore, the standard library already provides an entire module of tools for creating and working with lazy iterators in both Python 2 and Python 3: http://docs.python.org/library/itertools |
|
Date |
User |
Action |
Args |
2012-05-30 11:01:16 | ncoghlan | set | recipients:
+ ncoghlan, lehmannro, Ramchandra Apte, dair-targ |
2012-05-30 11:01:16 | ncoghlan | set | messageid: <1338375676.75.0.148612355844.issue14961@psf.upfronthosting.co.za> |
2012-05-30 11:01:16 | ncoghlan | link | issue14961 messages |
2012-05-30 11:01:15 | ncoghlan | create | |
|