diff options
author | yuki <126044367+F3eQnxN3RriK@users.noreply.github.com> | 2023-03-15 04:01:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 15:01:25 -0400 |
commit | 3d4a5831f9f64246404a6dac5c5059a71b020952 (patch) | |
tree | 0fff2282f2368d376c8ea102c45d904866c41812 /numpydoc/docscrape.py | |
parent | 9c59a469e5fddd688a62f953ac6c228e547b7a00 (diff) | |
download | numpydoc-main.tar.gz |
Diffstat (limited to 'numpydoc/docscrape.py')
-rw-r--r-- | numpydoc/docscrape.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 150325f..317bdab 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -727,7 +727,15 @@ class ClassDoc(NumpyDocString): return True -def get_doc_object(obj, what=None, doc=None, config=None): +def get_doc_object( + obj, + what=None, + doc=None, + config=None, + class_doc=ClassDoc, + func_doc=FunctionDoc, + obj_doc=ObjDoc, +): if what is None: if inspect.isclass(obj): what = "class" @@ -741,10 +749,10 @@ def get_doc_object(obj, what=None, doc=None, config=None): config = {} if what == "class": - return ClassDoc(obj, func_doc=FunctionDoc, doc=doc, config=config) + return class_doc(obj, func_doc=func_doc, doc=doc, config=config) elif what in ("function", "method"): - return FunctionDoc(obj, doc=doc, config=config) + return func_doc(obj, doc=doc, config=config) else: if doc is None: doc = pydoc.getdoc(obj) - return ObjDoc(obj, doc, config=config) + return obj_doc(obj, doc, config=config) |