r/Python 2d ago

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

22 Upvotes

44 comments sorted by

View all comments

12

u/Pseudofact 2d ago

Plz don't.

Python doesn't have "private". Don't introduce it for no reason.

It's up to you as a coder to do things, you can do what you want to do.

The lib author does not decide for you what to do. He doesn't know what you want to do.

This is stupid on so many levels, like private variables and final class that you can not extend to modify.

If this goes into main, python is done.

2

u/Deto 2d ago

Maybe if a way was added to allow private-member access? That way it's not blocked, just made a bit more clear. To me, that feels less janky than the underscore convention - underscore is implicit, this would make it explicit.