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

Method _pack_cookie

Lib/_pyio.py:2358–2366  ·  view source on GitHub ↗
(self, position, dec_flags=0,
                           bytes_to_feed=0, need_eof=False, chars_to_skip=0)

Source from the content-addressed store, hash-verified

2356 return not eof
2357
2358 def _pack_cookie(self, position, dec_flags=0,
2359 bytes_to_feed=0, need_eof=False, chars_to_skip=0):
2360 # The meaning of a tell() cookie is: seek to position, set the
2361 # decoder flags to dec_flags, read bytes_to_feed bytes, feed them
2362 # into the decoder with need_eof as the EOF flag, then skip
2363 # chars_to_skip characters of the decoded result. For most simple
2364 # decoders, tell() will often just give a byte offset in the file.
2365 return (position | (dec_flags<<64) | (bytes_to_feed<<128) |
2366 (chars_to_skip<<192) | bool(need_eof)<<256)
2367
2368 def _unpack_cookie(self, bigint):
2369 rest, position = divmod(bigint, 1<<64)

Callers 1

tellMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected