MCPcopy Index your code
hub / github.com/RustPython/RustPython / seek

Method seek

Lib/_pyio.py:1204–1213  ·  view source on GitHub ↗
(self, pos, whence=0)

Source from the content-addressed store, hash-verified

1202 return max(_BufferedIOMixin.tell(self) - len(self._read_buf) + self._read_pos, 0)
1203
1204 def seek(self, pos, whence=0):
1205 if whence not in valid_seek_flags:
1206 raise ValueError("invalid whence value")
1207 self._checkClosed("seek of closed file")
1208 with self._read_lock:
1209 if whence == 1:
1210 pos -= len(self._read_buf) - self._read_pos
1211 pos = _BufferedIOMixin.seek(self, pos, whence)
1212 self._reset_read_buf()
1213 return pos
1214
1215class BufferedWriter(_BufferedIOMixin):
1216

Callers

nothing calls this directly

Calls 4

_reset_read_bufMethod · 0.95
lenFunction · 0.85
_checkClosedMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected