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

Method _cache_bytecode

Lib/importlib/_bootstrap_external.py:791–799  ·  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

789 return {'mtime': self.path_mtime(path)}
790
791 def _cache_bytecode(self, source_path, cache_path, data):
792 """Optional method which writes data (bytes) to a file path (a str).
793
794 Implementing this method allows for the writing of bytecode files.
795
796 The source path is needed in order to correctly transfer permissions
797 """
798 # For backwards compatibility, we delegate to set_data()
799 return self.set_data(cache_path, data)
800
801 def set_data(self, path, data):
802 """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