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

Function _getowndoc

Lib/pydoc.py:171–184  ·  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

169 return None
170
171def _getowndoc(obj):
172 """Get the documentation string for an object if it is not
173 inherited from its class."""
174 try:
175 doc = object.__getattribute__(obj, '__doc__')
176 if doc is None:
177 return None
178 if obj is not type:
179 typedoc = type(obj).__doc__
180 if isinstance(typedoc, str) and typedoc == doc:
181 return None
182 return doc
183 except AttributeError:
184 return None
185
186def _getdoc(object):
187 """Get the documentation string for an object.

Callers 2

_finddocFunction · 0.85
_getdocFunction · 0.85

Calls 2

isinstanceFunction · 0.85
__getattribute__Method · 0.45

Tested by

no test coverage detected