Extended built-ins, etc.

Module Contents

class OrderedSet(*collections)

Ordered set based on uniqueness of dictionary keys.

Initialize self. See help(type(self)) for accurate signature.


D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]


Simple reversed enumerate.

natural_sort(iterable, reverse=False)

Sort alphanumeric strings naturally, i.e. with “1” before “10”. Based on

oscillate(iterable, max_passes=np.inf)

Oscillate forward and backward through an iterable.


Check if all objects in a collection are equal. If so, return one of them. If not, raise.

unify_attributes(objects, attr, require=True)

Unify object attributes.

replace(data, selectors, replacement)

Make an iterator that replaces elements from data with replacement when the corresponding element in selectors evaluates to True.

class DeferredTuple(entry_function, size)