On Mon, 25 Jan 2021 23:05:07 +0100
Victor Stinner <vstin...@python.org> 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 -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/2XBORMKGYQX2EYWXEEURSYRWJW3F3VKF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to