deltas(readings) yielding the difference between each consecutive pair from ANY iterable — including one-shot iterators, so you cannot index or zip the input with itself via two passes. Track the previous value as you go.list(deltas(iter([10, 13, 11])))
[3, -2]
Works on a pure iterator: 13-10 and 11-13.
Prime prev with next(it, sentinel).
Yield current - prev, then advance prev.