'Implement next as file does (like readline, except raises StopIteration
at EOF)'

def __next__(self):

    nextline = self.readline()
    if nextline:
        return nextline
    raise StopIteration()
