Author vstinner
Recipients serhiy.storchaka, vstinner
Date 2021-01-18.13:54:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610978084.16.0.975098822611.issue42955@roundup.psfhosted.org>
In-reply-to
Content
Use cases for sys.module_names:

* When computing dependencies of a project, ignore modules which are part of the stdlib: https://github.com/jackmaney/pypt/issues/3

* Trace the execution of third party code, but ignore stdlib, use --ignore-module option of trace: https://stackoverflow.com/questions/6463918/how-can-i-get-a-list-of-all-the-python-standard-library-modules

* When reformatting a Python source file, group imports of stdlib modules. The isort module contains the list of stdlib modules, one list py Python version: https://github.com/PyCQA/isort/tree/develop/isort/stdlibs which is generated from the online Python documentation.

---

The isort uses the following script to generate the list of stdlib modules:
https://github.com/PyCQA/isort/blob/develop/scripts/mkstdlibs.py

The script uses sphinx.ext.intersphinx.fetch_inventory(...)["py:module"]. This API uses objects.inv from the online Python documentation. Example of Python 3.9:

   https://docs.python.org/3.9/objects.inv

On the "dev" version, mkstdlibs.py lists 211 modules.
History
Date User Action Args
2021-01-18 13:54:44vstinnersetrecipients: + vstinner, serhiy.storchaka
2021-01-18 13:54:44vstinnersetmessageid: <1610978084.16.0.975098822611.issue42955@roundup.psfhosted.org>
2021-01-18 13:54:44vstinnerlinkissue42955 messages
2021-01-18 13:54:44vstinnercreate