Message385201
Another way to gather the list of Python modules: pydoc help("modules") uses pkgutil.walk_packages().
pydoc uses ModuleScanner which uses sys.builtin_module_names and pkgutil.walk_packages().
pkgutil.walk_packages() calls pkgutil.iter_modules() which iterates on sys.meta_path and sys.path, and calls iter_modules() on each importer.
For FileImporter, it iterates on os.listdir() on the importer path.
For zipimporter, it iterates on zipimport._zip_directory_cache[importer.archive]. |
|
Date |
User |
Action |
Args |
2021-01-18 15:06:38 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka |
2021-01-18 15:06:38 | vstinner | set | messageid: <1610982398.87.0.942289652697.issue42955@roundup.psfhosted.org> |
2021-01-18 15:06:38 | vstinner | link | issue42955 messages |
2021-01-18 15:06:38 | vstinner | create | |
|