def _read_nowait(self, n: int) -> bytes:
        """ Read not more than n bytes, or whole buffer is n == -1 """
        chunks = []

        while self._buffer:
            chunk = self._read_nowait_chunk(n)
            chunks.append(chunk)
            if n != -1:
                n -= len(chunk)
                if n == 0:
                    break

        return b''.join(chunks) if chunks else b''
def _read_nowait ( self , n : int ) -> bytes : chunks = [ ] while self . _buffer : chunk = self . _read_nowait_chunk ( n ) chunks . append ( chunk ) if n != - 1 : n -= len ( chunk ) if n == 0 : break return b'' . join ( chunks ) if chunks else b''
Read not more than n bytes, or whole buffer is n == -1