'next(x) -> the next value, or raise StopIteration'

def next(self):

    if self.closed:
        raise ValueError('I/O    operation    on    closed    file')
    if self.buf:
        rv = self.buf
        self.buf = None
        return rv
    else:
        return next(self.iterator)
