code: def readline(self, limit=-1, delim=b'\n'):
          
          self._check_readable()
          chunks = []
          while True:
              chunk = self._buffer.get_chunk(limit, delim)
              if not chunk:
                  break
              chunks.append(chunk)
              if chunk.endswith(delim):
                  break
              if limit >= 0:
                  limit -= len(chunk)
                  if limit == 0:
                      break
          if not chunks and not self._buffer.eof and self._buffer.error:
              raise compat.saved_exc(self._buffer.error)
          return b''.join(chunks)
docs: Read a single line.
  
          If EOF is reached before a full line can be read, a partial line is
          returned. If *limit* is specified, at most this many bytes will be read.