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
Let a range be a pair of sortable objects, e.g. a tuple of numbers, strings, date objects or anything implementing the __lt__ family operators (or maybe a sorting key function should be accepted in the mood of the sorted builtin!)
Given an iterable of ranges, I find myself rewriting functions to compute the intersection (usually of 2 ranges) and the union of those.
Let a range be a pair of sortable objects, e.g. a tuple of numbers, strings, date objects or anything implementing the
__lt__
family operators (or maybe a sorting key function should be accepted in the mood of thesorted
builtin!)Given an iterable of ranges, I find myself rewriting functions to compute the intersection (usually of 2 ranges) and the union of those.
For example
Input data might be not necessarily ordered.
E.g see https://stackoverflow.com/questions/52073609/get-unions-and-intersections-of-list-of-datetime-ranges-python
I think the boltons library should have a place for functions of this kind!
The text was updated successfully, but these errors were encountered: