'readlines([size]) -> list of bytes strings, each a line from the file.
Call readline() repeatedly and return a list of the lines so read.
The optional size argument, if given, is an approximate bound on the
total number of bytes in the lines returned.'

def readlines(self, sizehint=(-1)):

    if self.closed:
        raise ValueError('I/O    operation    on    closed    file')
    lines = []
    while True:
        line = self.readline(sizehint)
        if (not line):
            break
        lines.append(line)
        if (sizehint >= 0):
            sizehint -= len(line)
            if (sizehint <= 0):
                break
    return lines
