summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-08-06 21:19:22 (GMT)
committerBrett Cannon <brett@python.org>2012-08-06 21:19:22 (GMT)
commitd340b43d7524338ce3d63d4bd69477fca7dad23c (patch)
tree1a0e6231d2b4fa6cd46571bcf143873a650a029d /Lib/pydoc.py
parentcb4996afe4952e219d13bbb5a84162ab1aaa6887 (diff)
downloadcpython-d340b43d7524338ce3d63d4bd69477fca7dad23c.zip
cpython-d340b43d7524338ce3d63d4bd69477fca7dad23c.tar.gz
cpython-d340b43d7524338ce3d63d4bd69477fca7dad23c.tar.bz2
Issue #15163: Pydoc shouldn't show __loader__ as a part of a module's
data. Also alphabetized the attributes in the blacklist to make it easier to detect changes. Initial patch by Éric Araujo.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index a030f68..aa296c4 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -163,11 +163,11 @@ def _split_list(s, predicate):
def visiblename(name, all=None, obj=None):
"""Decide whether to show documentation on a variable."""
- # Certain special names are redundant.
- if name in {'__builtins__', '__doc__', '__file__', '__path__',
- '__module__', '__name__', '__slots__', '__package__',
- '__cached__', '__author__', '__credits__', '__date__',
- '__version__', '__qualname__', '__initializing__'}:
+ # Certain special names are redundant or internal.
+ if name in {'__author__', '__builtins__', '__cached__', '__credits__',
+ '__date__', '__doc__', '__file__', '__initializing__',
+ '__loader__', '__module__', '__name__', '__package__',
+ '__path__', '__qualname__', '__slots__', '__version__'}:
return 0
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1