def readline(self, size = -<NUM_LIT:1>):
if size < <NUM_LIT:0>:<EOL><INDENT>size = sys.maxsize<EOL><DEDENT>elif size == <NUM_LIT:0>:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>nl, nllen = self._checkfornewline()<EOL>if nl >= <NUM_LIT:0>:<EOL><INDENT>nl = min(nl, size)<EOL><DEDENT>else:<EOL><INDENT>size -= len(self.linebuffer)<EOL>while nl < <NUM_LIT:0> and size > <NUM_LIT:0>:<EOL><INDENT>buf = self.read(min(size, <NUM_LIT:100>))<EOL>if not buf:<EOL><INDENT>break<EOL><DEDENT>self.linebuffer += buf<EOL>size -= len(buf)<EOL>nl, nllen = self._checkfornewline()<EOL><DEDENT>if nl < <NUM_LIT:0>:<EOL><INDENT>s = self.linebuffer<EOL>self.linebuffer = '<STR_LIT>'<EOL>return s<EOL><DEDENT><DEDENT>buf = self.linebuffer[:nl]<EOL>self.lastdiscard = self.linebuffer[nl:nl + nllen]<EOL>self.linebuffer = self.linebuffer[nl + nllen:]<EOL>return buf + "<STR_LIT:\n>"<EOL>
Read a line with approx. size. If size is negative,
           read a whole line.