PyDocs

Nav

Importing Modules

source_from_cache

importlib.util

function · Added in 3.4 (source)
  • source_from_cache(path)
Given the path to a .pyc. file, return the path to its .py file.

The .pyc file does not need to exist; this simply returns the path to
the .py file calculated to correspond to the .pyc file.  If path does
not conform to PEP 3147/488 format, ValueError will be raised. If
sys.implementation.cache_tag is None then NotImplementedError is raised.
Changed in 3.6
  • 3.6: Accepts a path-like object.
0 Examples
No examples for importlib.util/source_from_cache.
See Also
No see-alsos for importlib.util/source_from_cache
0 Notes
No notes for source_from_cache