]> granicus.if.org Git - python/commitdiff
Issue #15163: Pydoc shouldn't show __loader__ as a part of a module's
authorBrett Cannon <brett@python.org>
Mon, 6 Aug 2012 21:19:22 +0000 (17:19 -0400)
committerBrett Cannon <brett@python.org>
Mon, 6 Aug 2012 21:19:22 +0000 (17:19 -0400)
data.

Also alphabetized the attributes in the blacklist to make it easier to
detect changes.

Initial patch by Éric Araujo.

Lib/pydoc.py
Misc/NEWS

index a030f685b0185b83b802dec004dbbf18631404e9..aa296c4c790465eb35dc1764bbe53df64bfd413c 100755 (executable)
@@ -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
index 4f590020f2b2e609fbfc67ea0aa14d38a7487094..4ac01632a422c7ca54e31ce7273134cac586a8e6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -77,6 +77,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #15163: Pydoc shouldn't list __loader__ as module data.
+
 - Issue #15471: Do not use mutable objects as defaults for
   importlib.__import__().