MCPcopy Index your code
hub / github.com/python/cpython / _pack_cookie

Method _pack_cookie

Lib/_pyio.py:2382–2390  ·  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

2380 return not eof
2381
2382 def _pack_cookie(self, position, dec_flags=0,
2383 bytes_to_feed=0, need_eof=False, chars_to_skip=0):
2384 # The meaning of a tell() cookie is: seek to position, set the
2385 # decoder flags to dec_flags, read bytes_to_feed bytes, feed them
2386 # into the decoder with need_eof as the EOF flag, then skip
2387 # chars_to_skip characters of the decoded result. For most simple
2388 # decoders, tell() will often just give a byte offset in the file.
2389 return (position | (dec_flags<<64) | (bytes_to_feed<<128) |
2390 (chars_to_skip<<192) | bool(need_eof)<<256)
2391
2392 def _unpack_cookie(self, bigint):
2393 rest, position = divmod(bigint, 1<<64)

Callers 1

tellMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected