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

Method read

tools/python-3.11.9-amd64/Lib/_pyio.py:941–960  ·  view source on GitHub ↗
(self, size=-1)

Source from the content-addressed store, hash-verified

939 super().close()
940
941 def read(self, size=-1):
942 if self.closed:
943 raise ValueError("read from closed file")
944 if size is None:
945 size = -1
946 else:
947 try:
948 size_index = size.__index__
949 except AttributeError:
950 raise TypeError(f"{size!r} is not an integer")
951 else:
952 size = size_index()
953 if size < 0:
954 size = len(self._buffer)
955 if len(self._buffer) <= self._pos:
956 return b""
957 newpos = min(len(self._buffer), self._pos + size)
958 b = self._buffer[self._pos : newpos]
959 self._pos = newpos
960 return bytes(b)
961
962 def read1(self, size=-1):
963 """This is the same as read.

Callers 5

_genopsFunction · 0.95
read1Method · 0.95
_dump_messageMethod · 0.95
_install_messageMethod · 0.95
_RealGetContentsMethod · 0.95

Calls 1

minFunction · 0.85

Tested by

no test coverage detected