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

Method path_stats

Lib/importlib/_bootstrap_external.py:760–772  ·  view source on GitHub ↗

Optional method returning a metadata dict for the specified path (a str). Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; - 'size' (optional) is the size in bytes of the source code. Implementing this

(self, path)

Source from the content-addressed store, hash-verified

758 raise OSError
759
760 def path_stats(self, path):
761 """Optional method returning a metadata dict for the specified
762 path (a str).
763
764 Possible keys:
765 - 'mtime' (mandatory) is the numeric timestamp of last source
766 code modification;
767 - 'size' (optional) is the size in bytes of the source code.
768
769 Implementing this method allows the loader to read bytecode files.
770 Raises OSError when the path cannot be handled.
771 """
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).

Callers 1

get_codeMethod · 0.95

Calls 1

path_mtimeMethod · 0.95

Tested by

no test coverage detected