On Tue, Jul 16, 2019 at 2:54 PM Andrew Barnert via Python-ideas
<python-ideas@python.org> wrote:
>
> And if that is the rule, there’s a lot of room for bikeshedding on the edges. 
> Does the stdlib then include curses because in theory it builds on any 
> platform if the lib is found, even though in practice nobody builds it on 
> Windows? Exclude multiprocessing and mmap because they’re not on all 
> platforms, only Windows and Unix (including Mac and Linux, and even most 
> third-party iOS and Android builds), which is all 99.9% of the Python world 
> cares about? Exclude dis because it’s CPython-specific even though PyPy 
> includes it as well?
>

I'm not 100% sure of use-cases, but one potential use for this would
be to check for accidental name collisions. That wouldn't need to
include the *contents* of every module, just as long as it has the
*name* (and this also deals with packages, since you need only the top
level). In this way, it would be more parallel to the "keyword" module
than "builtins"; you could have "import stdlib;
print(stdlib.module_names)" or do a quick set intersection check
against your file names.

To that end, it would be best if it includes EVERY module that would
be considered standard, including all of the ones you mentioned.
(Possibly internal implementation modules should be separate, but
anything public-facing should be included.) It'd be a quick tool for
checking for collisions across Python platforms, versions (just load
up another version's stdlib.py and check it), etc, etc.

Actually figuring out which ones can be imported is a much harder job,
albeit a simple one - just call __import__ on every name and see which
ones bomb with ImportError.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/NALK27VTULZ6TL5VMYSAQONAYPKFQXZA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to