Issue 3190: pydoc now hides module __package__ attributes

This commit is contained in:
Nick Coghlan 2008-07-02 13:09:19 +00:00
parent 70c3289085
commit c060b0e7eb
3 changed files with 6 additions and 4 deletions

View file

@ -160,8 +160,9 @@ def _split_list(s, predicate):
def visiblename(name, all=None):
"""Decide whether to show documentation on a variable."""
# Certain special names are redundant.
if name in ('__builtins__', '__doc__', '__file__', '__path__',
'__module__', '__name__', '__slots__'): return 0
_hidden_names = ('__builtins__', '__doc__', '__file__', '__path__',
'__module__', '__name__', '__slots__', '__package__')
if name in _hidden_names: return 0
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1
if all is not None: