cyclic_pairs

sknano.core.itertools.cyclic_pairs(iterable)[source] [edit on github][source]

Return iterator over all subsequence pairs in iterable, up to last and first element pair.

Returns:
Return type:Iterator

Examples

>>> list(cyclic_pairs('ABC'))
[('A', 'B'), ('B', 'C'), ('C', 'A')]