all_are_pairs_of_types

mathtools.all_are_pairs_of_types(argument, first_type, second_type)

Is true when argument is an iterable collection whose members are all of length 2, and where the first member of each pair is an instance of first_type and where the second member of each pair is an instance of second_type. Otherwise false.

>>> items = [(1., 'a'), (2.1, 'b'), (3.45, 'c')]
>>> mathtools.all_are_pairs_of_types(items, float, str)
True
>>> mathtools.all_are_pairs_of_types('foo', float, str)
False

Is true when argument is empty:

>>> mathtools.all_are_pairs_of_types([], float, str)
True

Returns true or false.