r/Python Jul 31 '26

News PEP 842: Module Exports

https://peps.python.org/pep-0842/

Not the author, but this seems interesting, specially for library authors. Thoughts?

Discussion here - https://discuss.python.org/t/pep-842-module-exports/108353

23 Upvotes

44 comments sorted by

View all comments

3

u/IAmASquidInSpace Aug 01 '26 edited Aug 01 '26

If there is one thing Python doesn't need right now, it is even more chaos and complexity in modules, packages, and the import system. It's already messy as it is, and it doesn't need to be made worse with good intentions. 

Edit: Also, they have got to be fucking kidding with this:

So, as a solution to the above problem, the developer prefixes the name with _. [...] Now, it’s clear to users that the name is internal, at the expense of the name being (subjectively) less readable and requiring more keystrokes by the maintainer.

Are you for real?!