>>333
from toolz import partition_all
foo = [12,54,67,89,22]
for x in partition_all(2, foo):
...: print(x)

(12, 54)
(67, 89)
(22,)