Skip to content
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
JelleZijlstra committed Jun 21, 2024
commit b845c0e1fc150232c826090e7665636116e94efb
1 change: 1 addition & 0 deletions Lib/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
# Recurse to methods, properties, and nested classes.
if ((inspect.isroutine(val) or inspect.isclass(val) or
isinstance(val, property)) and
valname != '__annotations__' and
self._from_module(module, val)):
valname = '%s.%s' % (name, valname)
self._find(tests, val, valname, module, source_lines,
Expand Down
4 changes: 3 additions & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,10 @@ def visiblename(name, all=None, obj=None):
'__date__', '__doc__', '__file__', '__spec__',
'__loader__', '__module__', '__name__', '__package__',
'__path__', '__qualname__', '__slots__', '__version__',
'__static_attributes__', '__firstlineno__'}:
'__static_attributes__', '__firstlineno__', '__annotations__'}:
return 0
if name == '__annotate__' and getattr(obj, name, None) is None:
return False
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1
# Namedtuples have public fields and methods with a single leading underscore
Expand Down