def next(self):
    with self._condition:
        while self._paused:
            self._condition.wait()
    return next(self._upstream)
def next(self):
    with self._condition:
        while self._paused:
            self._condition.wait()
    return next(self._upstream)