MCPcopy Index your code
hub / github.com/RustPython/RustPython / document

Method document

Lib/pydoc.py:540–554  ·  view source on GitHub ↗

Generate documentation for an object.

(self, object, name=None, *args)

Source from the content-addressed store, hash-verified

538 % sys.version_info[:2])
539
540 def document(self, object, name=None, *args):
541 """Generate documentation for an object."""
542 args = (object, name) + args
543 # 'try' clause is to attempt to handle the possibility that inspect
544 # identifies something in a way that pydoc itself has issues handling;
545 # think 'super' and how it is a descriptor (which raises the exception
546 # by lacking a __name__ attribute) and an instance.
547 try:
548 if inspect.ismodule(object): return self.docmodule(*args)
549 if inspect.isclass(object): return self.docclass(*args)
550 if inspect.isroutine(object): return self.docroutine(*args)
551 except AttributeError:
552 pass
553 if inspect.isdatadescriptor(object): return self.docdata(*args)
554 return self.docother(*args)
555
556 def fail(self, object, name=None, *args):
557 """Raise an exception for unimplemented types."""

Callers 11

docmoduleMethod · 0.80
spillMethod · 0.80
docmoduleMethod · 0.80
spillMethod · 0.80
render_docFunction · 0.80
writedocFunction · 0.80
html_getobjFunction · 0.80
test_async_annotationMethod · 0.80
documentFunction · 0.80

Calls 5

docmoduleMethod · 0.45
docclassMethod · 0.45
docroutineMethod · 0.45
docdataMethod · 0.45
docotherMethod · 0.45

Tested by 3

test_async_annotationMethod · 0.64