help(module) only provides help on classes and functions that were first defined within the module. For wrapper modules (like re), or partially-in-C modules (like socket) this is not helpful. The following patch changes pydoc(module) to document exactly the names listed in __all__, with a fallback to the current choices if __all__ is not defined.
Logged In: YES user_id=764593 Replacing with an improved version. This is a diff to CVS head; users of Python 2.3 would have to either change the line numbers or also replace collections.deque. (Setting deque to list was enough to allow testing.) [Original patch had a problem with normal modules, but the exception was caught at a higher level, and *something* returned, so I didn't notice it at first.]
Logged In: YES user_id=469548 Right now all four hunks of the patch are failing for me (probably because of #969938, which fixes part of the problem). Could you update the patch to CVS HEAD and assign to me afterwards? I'll take a good look at it then.
Logged In: YES user_id=764593 Yes, the earlier patch fixes most of this, and cleans up the remainder. The only thing left is to make sure visiblename gets called on even imported objects. Style question: Should I use "if all" or "if all is not None". The only time it would make a difference is with an unusual imported special name. (__*__, but not __builtins__, __doc__, __file__, __path__, __module__, or __name__). Given that all has been bound to object.__all__ (or to None, in case of AttributeError), should I (1) Use "if all is not None or ..." to emphasize that I'm avoiding a special case (__all__ not defined) or (2) Use "if all or ..." because it is shorter