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

Function _code_to_timestamp_pyc

Lib/importlib/_bootstrap_external.py:511–518  ·  view source on GitHub ↗

Produce the data for a timestamp-based pyc.

(code, mtime=0, source_size=0)

Source from the content-addressed store, hash-verified

509
510
511def _code_to_timestamp_pyc(code, mtime=0, source_size=0):
512 "Produce the data for a timestamp-based pyc."
513 data = bytearray(MAGIC_NUMBER)
514 data.extend(_pack_uint32(0))
515 data.extend(_pack_uint32(mtime))
516 data.extend(_pack_uint32(source_size))
517 data.extend(marshal.dumps(code))
518 return data
519
520
521def _code_to_hash_pyc(code, source_hash, checked=True):

Callers 1

get_codeMethod · 0.85

Calls 3

_pack_uint32Function · 0.85
extendMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…