MCPcopy Index your code
hub / github.com/python/cpython / _getowndoc

Function _getowndoc

Lib/inspect.py:777–790  ·  view source on GitHub ↗

Get the documentation string for an object if it is not inherited from its class.

(obj)

Source from the content-addressed store, hash-verified

775 return None
776
777def _getowndoc(obj):
778 """Get the documentation string for an object if it is not
779 inherited from its class."""
780 try:
781 doc = object.__getattribute__(obj, '__doc__')
782 if doc is None:
783 return None
784 if obj is not type:
785 typedoc = type(obj).__doc__
786 if isinstance(typedoc, str) and typedoc == doc:
787 return None
788 return doc
789 except AttributeError:
790 return None
791
792def getdoc(object, *, fallback_to_class_doc=True, inherit_class_doc=True):
793 """Get the documentation string for an object.

Callers 1

getdocFunction · 0.85

Calls 1

__getattribute__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…