def get_after(sentinel, iterable): "Get the value after `sentinel` in an `iterable`" truncated = dropwhile(lambda el: el != sentinel, iterable) next(truncated) return next(truncated)