(self, size=None)
Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
Read at most size bytes, returned as bytes.
Read at most size bytes returned as bytes .
def read(self, size=None):
        """Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        """
        self._checkClosed()
        self._checkReadable()
        if size is None or size < 0:
            return self.readall()
        try:
            return os.read(self._fd, size)
        except BlockingIOError:
            return None
def read ( self , size = None ) : self . _checkClosed ( ) self . _checkReadable ( ) if size is None or size < 0 : return self . readall ( ) try : return os . read ( self . _fd , size ) except BlockingIOError : return None