Message161943
| Author |
ncoghlan |
| Recipients |
Ramchandra Apte, dair-targ, lehmannro, ncoghlan |
| Date |
2012年05月30日.11:01:15 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338375676.75.0.148612355844.issue14961@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| 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 |
|