We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac37b77 commit b36972dCopy full SHA for b36972d
Lib/pydoc.py
@@ -1706,6 +1706,11 @@ def describe(thing):
1706
1707
def locate(path, forceload=0):
1708
"""Locate an object by name or dotted path, importing as necessary."""
1709
+ if re.match(r"^__\w+__$", path):
1710
+ # if we're looking up a special variable, don't grab the result from
1711
+ # the builtins module, because it's probably not what the user wanted
1712
+ # (if it is, they can look up builtins.whatever)
1713
+ return None
1714
parts = [part for part in path.split('.') if part]
1715
module, n = None, 0
1716
while n < len(parts):
0 commit comments