all_are_pairs

mathtools.all_are_pairs(argument)

Is true when argument is an iterable collection of pairs. Otherwise false.

>>> mathtools.all_are_pairs([(1, 2), (3, 4), (5, 6), (7, 8)])
True
>>> mathtools.all_are_pairs('foo')
False

Is true when argument is empty:

>>> mathtools.all_are_pairs([])
True

Returns true or false.