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

Method _cache_bytecode

Lib/importlib/_bootstrap_external.py:774–782  ·  view source on GitHub ↗

Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions

(self, source_path, cache_path, data)

Source from the content-addressed store, hash-verified

772 return {'mtime': self.path_mtime(path)}
773
774 def _cache_bytecode(self, source_path, cache_path, data):
775 """Optional method which writes data (bytes) to a file path (a str).
776
777 Implementing this method allows for the writing of bytecode files.
778
779 The source path is needed in order to correctly transfer permissions
780 """
781 # For backwards compatibility, we delegate to set_data()
782 return self.set_data(cache_path, data)
783
784 def set_data(self, path, data):
785 """Optional method which writes data (bytes) to a file path (a str).

Callers 1

get_codeMethod · 0.95

Calls 1

set_dataMethod · 0.95

Tested by

no test coverage detected