Message 285092 - Python tracker (original) (raw)
Chiming in so Barry & Zach can take this feedback into account for any future proposal:
I think the specific term "public" has too much baggage from other languages, especially in the sense that it implies that "private" is the default. In reality, all attributes in Python are public, with all serving as executable documentation and a constraint on wildcard exports
the notion of an automatically supplied all object that defaults to reporting [name for name in dir(module) if not name.startswith("_")] has a lot more to recommend it (as it encodes the default wildcard export behaviour directly into the language implementation, rather than requiring that module analysis tools implement that default themselves)
given "all" as the base name, the method name for class and function registration could just be the generic "all.register" (although "all.export" would also work, since it's the counterpart of "import *")
using an object namespace would allow for other registration methods if that seemed appropriate
Even then, I'm at best +0 on the proposal, but I also don't make heavy use of code development helpers (IDEs, etc)