MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / document

Method document

tools/python-3.11.9-amd64/Lib/pydoc.py:486–500  ·  view source on GitHub ↗

Generate documentation for an object.

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

Source from the content-addressed store, hash-verified

484 % sys.version_info[:2])
485
486 def document(self, object, name=None, *args):
487 """Generate documentation for an object."""
488 args = (object, name) + args
489 # 'try' clause is to attempt to handle the possibility that inspect
490 # identifies something in a way that pydoc itself has issues handling;
491 # think 'super' and how it is a descriptor (which raises the exception
492 # by lacking a __name__ attribute) and an instance.
493 try:
494 if inspect.ismodule(object): return self.docmodule(*args)
495 if inspect.isclass(object): return self.docclass(*args)
496 if inspect.isroutine(object): return self.docroutine(*args)
497 except AttributeError:
498 pass
499 if inspect.isdatadescriptor(object): return self.docdata(*args)
500 return self.docother(*args)
501
502 def fail(self, object, name=None, *args):
503 """Raise an exception for unimplemented types."""

Callers 9

docmoduleMethod · 0.80
spillMethod · 0.80
docmoduleMethod · 0.80
spillMethod · 0.80
render_docFunction · 0.80
writedocFunction · 0.80
html_getobjFunction · 0.80
_check_rst_dataMethod · 0.80
_check_rst_dataMethod · 0.80

Calls 5

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

Tested by

no test coverage detected