MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read

Method read

tools/python-3.11.9-amd64/Lib/_pyio.py:637–652  ·  view source on GitHub ↗

Read and return up to size bytes, where size is an int. Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read.

(self, size=-1)

Source from the content-addressed store, hash-verified

635 # a subclass doesn't implement either.)
636
637 def read(self, size=-1):
638 """Read and return up to size bytes, where size is an int.
639
640 Returns an empty bytes object on EOF, or None if the object is
641 set not to block and has no data to read.
642 """
643 if size is None:
644 size = -1
645 if size < 0:
646 return self.readall()
647 b = bytearray(size.__index__())
648 n = self.readinto(b)
649 if n is None:
650 return None
651 del b[n:]
652 return bytes(b)
653
654 def readall(self):
655 """Read until EOF, using multiple read() call."""

Callers 1

readallMethod · 0.95

Calls 3

readallMethod · 0.95
readintoMethod · 0.95
__index__Method · 0.45

Tested by

no test coverage detected