Hello,
i propose the attached patch to change the rule to
define what container an object belongs to.
Currently an object defined in a .so module (it should
be a .pyd on Windows, but this wasn't checked) belongs
to it. Often the .so object is just an implementative
detail and python modules are used to shape the package
in its public form.
Of course often objects are imported from .so/.pyd
modules just to be used into the bodule and are not
part of the public api.
The patched version first checks if the object is
inside a .py module AND in its __all__ list: such
module has precedence on any .so/.pyc.
A second update is related to modules public/private
state. Currently modules are public only if they are
iported from another public module. Often this is not
the case: many packages are not made to be imported
interely, but present a tree structure and people can
use "import parent.child1.child2" effectively loading
only the required module.
The patch marks as "public" all the modules explicitely
specified on the command line, unless its name doesn't
start with an underscore.
Logged In: YES
user_id=1053920
Patch moved to the exp-all-is-interface CVS branch.
Logged In: YES
user_id=195958
This patch looks good to me -- although it might be a good
idea to add a few try/except blocks in case __all__ isn't
a list.
-Edward
Logged In: YES
user_id=195958
Epydoc 3.0 is basically taking this approach: if a
variable is explicitly listed in __all__, then it's
treated like it's not imported.