Skip to main content

iter_all_python_module_files

Iterates through all currently loaded Python modules by creating a stable sorted list of module objects and passing them to a helper function to retrieve their associated file paths.

def iter_all_python_module_files() - > generator

Yields file paths for all currently loaded Python modules by performing a stable sort of the system module registry. This function is optimized for hot-path reloading by ensuring consistent iteration order and filtering out weak references.

Returns

TypeDescription
generatorAn iterator yielding file system paths for every module currently present in sys.modules.