Implement windowed(iterable, n, step=1), a generator of tuples of n consecutive items, advancing step items each time. It must work on infinite and one-shot iterators, holding at most n items in memory (use collections.deque(maxlen=n)).
Don't yield a final short window. If the input is shorter than n, yield nothing.
Then implement pairwise_diffs(iterable): a generator of differences between consecutive items, built on windowed.