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

Method seek

tools/python-3.11.9-amd64/Lib/_pyio.py:1230–1238  ·  view source on GitHub ↗
(self, pos, whence=0)

Source from the content-addressed store, hash-verified

1228 return max(_BufferedIOMixin.tell(self) - len(self._read_buf) + self._read_pos, 0)
1229
1230 def seek(self, pos, whence=0):
1231 if whence not in valid_seek_flags:
1232 raise ValueError("invalid whence value")
1233 with self._read_lock:
1234 if whence == 1:
1235 pos -= len(self._read_buf) - self._read_pos
1236 pos = _BufferedIOMixin.seek(self, pos, whence)
1237 self._reset_read_buf()
1238 return pos
1239
1240class BufferedWriter(_BufferedIOMixin):
1241

Callers

nothing calls this directly

Calls 2

_reset_read_bufMethod · 0.95
seekMethod · 0.45

Tested by

no test coverage detected