Get the documentation string for an object if it is not inherited from its class.
(obj)
| 153 | return None |
| 154 | |
| 155 | def _getowndoc(obj): |
| 156 | """Get the documentation string for an object if it is not |
| 157 | inherited from its class.""" |
| 158 | try: |
| 159 | doc = object.__getattribute__(obj, '__doc__') |
| 160 | if doc is None: |
| 161 | return None |
| 162 | if obj is not type: |
| 163 | typedoc = type(obj).__doc__ |
| 164 | if isinstance(typedoc, str) and typedoc == doc: |
| 165 | return None |
| 166 | return doc |
| 167 | except AttributeError: |
| 168 | return None |
| 169 | |
| 170 | def _getdoc(object): |
| 171 | """Get the documentation string for an object. |
no test coverage detected