You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
more-itertools has various split_ functions (split_at, split_after, split_before, split_when, split_into) but none of these functions has a way to stop the split after a given number of elements. Of course, we can take the first elements of a split_... iterator and swtich to the original iterator:
maxsplit
more-itertools has various
split_
functions (split_at
,split_after
,split_before
,split_when
,split_into
) but none of these functions has a way to stop the split after a given number of elements. Of course, we can take the first elements of asplit_...
iterator and swtich to the original iterator:But it would be more convenient to write, as we do with
str.split
:(The last parameter could be an iterator to remain lazy).
reverse
We could have another parameter, named
reverse
to mimicstr.rsplit
:(Or create
rsplit_at
,rsplit_after
, ... but that would be a little cumbersome)Implementation should not be difficult.
The text was updated successfully, but these errors were encountered: