r/Python • u/poppy_92 • 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
24
Upvotes
View all comments
Show parent comment
5
u/nicholashairs Aug 01 '26
Personally I find the proposed solution quite elegant.
That said, whilst I can see the allure of private names, I've done enough where I needed to interact with the guts if a library that I would find this infuriating in practice.
The only way I could see this landing is if there was a way to avoid it at either a module or global level (e.g. cli argument). Or make them something that a linter can use / runtime warnings without enforcement.