Get the documentation string for an object if it is not inherited from its class.
(obj)
| 775 | return None |
| 776 | |
| 777 | def _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 | |
| 792 | def getdoc(object, *, fallback_to_class_doc=True, inherit_class_doc=True): |
| 793 | """Get the documentation string for an object. |
no test coverage detected
searching dependent graphs…