This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: help on re-exported names (bug 925628)
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: jlgijsbers Nosy List: jimjjewett, jlgijsbers
Priority: normal Keywords: patch

Created on 2004-04-13 17:02 by jimjjewett, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pydocfromhead.txt jimjjewett, 2004-04-16 20:24
pydoc.diff jimjjewett, 2004-08-27 01:22 patch to cvs head as of aug 25, 2004
Messages (6)
msg45746 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-04-13 17:02
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.
msg45747 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-04-16 20:23
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.]
msg45748 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-08-21 11:46
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.
msg45749 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-08-26 05:36
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
msg45750 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-08-30 14:14
Logged In: YES 
user_id=469548

'if all is not None': explicit is better than implicit. I
checked this in as rev 1.98 of pydoc.py. Thanks for the patch!
msg45751 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-08-30 16:48
Logged In: YES 
user_id=764593

Thank you for applying it!
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40145
2004-04-13 17:02:07jimjjewettcreate