(iterable)
return zip(a, b)
s -> (s0,s1), (s1,s2), (s2, s3), ..., (sN, None)
s -> (s0,s1), (s1,s2), (s2, s3), ..., (sN, None)
s - > ( s0 s1 ) ( s1 s2 ) ( s2 s3 ) ... ( sN None )
def pairwise(iterable):
    "s -> (s0,s1), (s1,s2), (s2, s3), ..., (sN, None)"
    a, b = itt.tee(iterable + [None])
    next(b, None)
    return zip(a, b)
def pairwise ( iterable ) : a , b = itt . tee ( iterable + [ None ] ) next ( b , None ) return zip ( a , b )