for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use a heuristic.
if (all is not None
+ or inspect.isbuiltin(value)
or (inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
funcs.append((key, value))
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use a heuristic.
if (all is not None
+ or inspect.isbuiltin(value)
or (inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
funcs.append((key, value))
if not support.MISSING_C_DOCSTRINGS:
self.assertIn(' | get(key, default=None, /) method of builtins.dict instance', lines)
self.assertIn(' | dict_get = get(key, default=None, /) method of builtins.dict instance', lines)
+ self.assertIn(' | sin(x, /)', lines)
else:
self.assertIn(' | get(...) method of builtins.dict instance', lines)
self.assertIn(' | dict_get = get(...) method of builtins.dict instance', lines)
+ self.assertIn(' | sin(...)', lines)
lines = self.getsection(result, f' | Class methods {where}:', ' | ' + '-'*70)
self.assertIn(' | B_classmethod(x)', lines)
self.assertIn(' __repr__(...) unbound builtins.object method', lines)
self.assertIn(' object_repr = __repr__(...) unbound builtins.object method', lines)
+ # builtin functions
+ if not support.MISSING_C_DOCSTRINGS:
+ self.assertIn(' sin(x, /)', lines)
+ else:
+ self.assertIn(' sin(...)', lines)
def test_html_doc_routines_in_module(self):
doc = pydoc.HTMLDoc()
self.assertIn(' __repr__(...) unbound builtins.object method', lines)
self.assertIn(' object_repr = __repr__(...) unbound builtins.object method', lines)
+ # builtin functions
+ if not support.MISSING_C_DOCSTRINGS:
+ self.assertIn(' sin(x, /)', lines)
+ else:
+ self.assertIn(' sin(...)', lines)
+
@unittest.skipIf(
is_emscripten or is_wasi,