diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-02 13:09:19 +0000 |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-02 13:09:19 +0000 |
commit | c060b0e7eb140cb13dfb51f954883241f1ddabc6 (patch) | |
tree | 3830e69b54e6d84ad5e6ca36d0fc1de2f4f14094 /Lib/pydoc.py | |
parent | 70c3289085d08d97edbfaa626efc2d2c2ac21859 (diff) | |
download | cpython-git-c060b0e7eb140cb13dfb51f954883241f1ddabc6.tar.gz |
Issue 3190: pydoc now hides module __package__ attributes
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 58e80676d1..2035f7889e 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: |