
Nov. 23, 2021
12:16 a.m.
On 23/11/21 3:15 am, Remy wrote:
Iterators to implement 'transformational' functions like map, filter, flat_map, 'reductional' functions like reduce, sum, join, and 'evaluate' functions like to_list and to_set.
This would place a burden on all iterators to implement a large and complex interface. This goes directly against the philosophy of Python protocols, which is to be as minimal as possible. Do one thing, and do it well. It would also be a huge backwards-incompatible change. And where do you stop? You've picked an arbitrary subset of things one might want to do with an iterator. Why those particular ones? What about the contents of the itertools module? Should they be included too? Why or why not? -- Greg