stdlib-list icon indicating copy to clipboard operation
stdlib-list copied to clipboard

Get this into Python

Open encukou opened this issue 4 years ago • 6 comments

There's a (rather inactive right now) PEP that would need to get a list like this into Python itself: PEP 534

Do you want to help incorporate a list of modules into Python 3.9+? This would mean either building it automatically, or at least automatically checking if it is still valid (on all platforms)?

cc @torsava

encukou avatar Aug 19 '19 11:08 encukou

@encukou do you think any further action is required here? My understanding is that sys.stdlib_module_names + sys.builtin_module_names on 3.10+ effectively supplant this library for users who only need the module list for their specific running version :slightly_smiling_face:

woodruffw avatar Jun 10 '23 20:06 woodruffw

sys.stdlib_module_names should be enough. (IMO builtin_module_names is for things like importers, which care about built-in-ness rather than stdlib-ness. Custom builds of Python might have non-stdlib modules built in.)

Note that sys.stdlib_module_names doesn't list:

  • submodules, but I don't know of a use case where those would be useful;
  • test modules, including test, which does leave some use cases out IMO.

But any issues would be better handled in CPython rather than this repo.

encukou avatar Jun 12 '23 12:06 encukou

pydeps has a use case for submodules (I need to know which modules to exclude). Sure I could do a prefix match, but the current stdlib-list implementation is very convenient for my use-case. See also issue #58

thebjorn avatar Jun 12 '23 14:06 thebjorn

pydeps has a use case for submodules (I need to know which modules to exclude). Sure I could do a prefix match, but the current stdlib-list implementation is very convenient for my use-case. See also issue #58

Yep, I intend to maintain this behavior with the new Python version support.

woodruffw avatar Jun 12 '23 14:06 woodruffw

Then, from my point of view (the suggester), this issue stands. It would be great to have this in stdlib. The issue is that curating the list of submodules by hand is too fragile, and scraping our own docs doesn't sound right.

Up to you if you want to keep the issue open -- it would need some design effort and discussion. I'd be happy to help but can't drive it.

encukou avatar Jun 12 '23 14:06 encukou

Sounds good! This isn't a priority for me immediately, but I'll reopen to keep it alive.

woodruffw avatar Jun 12 '23 15:06 woodruffw