diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 58e80676d1d..2035f7889ee 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -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: diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index c78e986e2b8..91a997783c5 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -57,7 +57,6 @@ FUNCTIONS DATA __author__ = 'Benjamin Peterson' __credits__ = 'Nobody' - __package__ = None __version__ = '1.2.3.4' VERSION @@ -146,7 +145,6 @@ war