[Python-Dev] Re: New sys.module_names attribute in Python 3.10: list of all stdlib modules

2021年1月26日 01:31:15 -0800

On 2021年1月25日 23:05:07 +0100
Victor Stinner <[email protected]> wrote:
> 
> This is a different use case which requires a different solution.
> sys.module_names solve some specific use cases (that I listed in my
> first email).
> 
> In Python 3.9, you can already check if a module __file__ is in the
> sysconfig.get_paths()['stdlib'] directory. You don't need to modify
> Python for that.
Is this reliable? What if the stdlib is zipped or frozen in some way?
> If you also would like to check if an *extension* module comes from
> the stdlib, you need to get the "lib-dynload" directory.
So you're saying the need is already fulfilled, even though it only has
a cryptic (*) and partial solution?
(*) who would think about `sysconfig.get_paths()['stdlib']` on their
own?
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/2XBORMKGYQX2EYWXEEURSYRWJW3F3VKF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to