swh.core.collections module

class swh.core.collections.SortedList(*args, **kwds)[source]

Bases: collections.UserList, typing.Generic

data: List[Tuple[SortedListKey, SortedListItem]]
add(item: SortedListItem)[source]
iter_from(start_key: Any) → Iterator[SortedListItem][source]

Returns an iterator over all the elements whose key is greater or equal to start_key. (This is an efficient equivalent to: (x for x in L if key(x) >= start_key))

iter_after(start_key: Any) → Iterator[SortedListItem][source]

Same as iter_from, but using a strict inequality.