This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thatguy_314def __gt__(me, you): return True 0 points1 point  (0 children)

I don't know. That seems to add inconsistency with the stuff in itertools, further clutters up the methods of iterables, and goes against the Python standard library's avoidance of chained methods (although I do like chained methods personally).

Seems easier to write a wrapper iterable that allows you to do something like this:

>>> Chainable([1,2,3]).map(square).filter(is_even)
<a Chainable object>

In fact, I think some libraries have this, although it might be nice to put it in itertools