pydistsim.utils.helpers

Functions

first

Return the first item in an iterable, or a default value if the iterable is empty.

len_is_not_zero

Returns true if the iterable has at least one element without consuming it entirely.

len_is_one

Returns true if the iterable has one element without consuming it entirely.

measure_sortedness

Measure the sortedness of a sequence.

pydistsim_equal_objects

Compare two objects and their attributes, but allow for non immutable attributes to be equal up to their class.

with_typehint

Useful function to make mixins with baseclass typehint without actually inheriting from it.