On Mon, Jan 25, 2021 at 4:18 PM Antoine Pitrou <antoine@python.org> wrote:
On Mon, 25 Jan 2021 14:03:22 +0100 Victor Stinner <vstinner@python.org> wrote:
The list is opinionated and defined by its documentation:
So "the list is opinionated" means there can be false negatives, i.e. some stdlib modules which are not present in this list?
Test modules of the stdlib are excluded. Example:
import sys '_testcapi' in sys.module_names # _testcapi extension False 'test' in sys.module_names # Lib/test/ package False import _testcapi _testcapi <module '_testcapi' from '/home/vstinner/python/master/build/lib.linux-x86_64-3.10-pydebug/_testcapi.cpython-310d-x86_64-linux-gnu.so'> import test test <module 'test' from '/home/vstinner/python/master/Lib/test/__init__.py'>
It can be changed if it's an issue. That's also why I sent an email to python-dev, to see if there is something wrong with sys.module_names definition. Victor -- Night gathers, and now my watch begins. It shall not end until my death.