Nick Coghlan added the comment:
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)
----------
nosy: +ncoghlan
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com