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
3
u/HommeMusical Aug 01 '26
But "the list things that get imported from a namespace" has never been an API and isn't anything like an API."
If you type
import moduleand then make the assumption that everything in themodule.namespace will always be there in every version and have the same meaning and signatuire, even for undocumented members that start with an_and aren't in__all__, you're going have a very bad time.We have
__all__; we have the_prefix convention; for APIs, we have type stubs.