def get_docstring( obj: model.Documentable ) -> Tuple[Optional[str], Optional[model.Documentable]]: for source in obj.docsources(): doc = source.docstring if doc: return doc, source if doc is not None: # Treat empty docstring as undocumented. return None, source return None, None
def hasdocstring(ob: model.Documentable) -> bool: for source in ob.docsources(): if source.docstring is not None: return True return False