diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-03 13:33:37 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-04 13:50:10 +0900 |
commit | 2d37ba44193aac1f7082382ceb34e85078e64a32 (patch) | |
tree | 083750941760866cca77aeafdf8979bea33066b8 | |
parent | d8cb7aa4f668f1bf92458372568e1be110501eb8 (diff) | |
download | sphinx-git-2d37ba44193aac1f7082382ceb34e85078e64a32.tar.gz |
autodoc: deprecate SingledispatchFunctionDocumenter
In #7487, SingledispatchFunctionDocumenter is merged into
FunctionDocumenter. SingledispatchMethodDocumenter is also. As a result,
They are no longer needed. So this deprecates them.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | doc/extdev/deprecated.rst | 10 | ||||
-rw-r--r-- | sphinx/ext/autodoc/__init__.py | 10 |
3 files changed, 22 insertions, 0 deletions
@@ -12,6 +12,8 @@ Deprecated * ``sphinx.builders.latex.LaTeXBuilder.usepackages`` * ``sphinx.builders.latex.LaTeXBuilder.usepackages_afger_hyperref`` +* ``sphinx.ext.autodoc.SingledispatchFunctionDocumenter`` +* ``sphinx.ext.autodoc.SingledispatchMethodDocumenter`` Features added -------------- diff --git a/doc/extdev/deprecated.rst b/doc/extdev/deprecated.rst index d7ad21fff..2bb8aebfd 100644 --- a/doc/extdev/deprecated.rst +++ b/doc/extdev/deprecated.rst @@ -36,6 +36,16 @@ The following is a list of deprecated interfaces. - 5.0 - N/A + * - ``sphinx.ext.autodoc.SingledispatchFunctionDocumenter`` + - 3.3 + - 5.0 + - ``sphinx.ext.autodoc.FunctionDocumenter`` + + * - ``sphinx.ext.autodoc.SingledispatchMethodDocumenter`` + - 3.3 + - 5.0 + - ``sphinx.ext.autodoc.MethodDocumenter`` + * - ``sphinx.ext.autodoc.members_set_option()`` - 3.2 - 5.0 diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index d7c5d2242..6eff27102 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1302,6 +1302,11 @@ class SingledispatchFunctionDocumenter(FunctionDocumenter): Retained for backwards compatibility, now does the same as the FunctionDocumenter """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + warnings.warn("%s is deprecated." % self.__class__.__name__, + RemovedInSphinx50Warning, stacklevel=2) + super().__init__(*args, **kwargs) + class DecoratorDocumenter(FunctionDocumenter): """ @@ -1936,6 +1941,11 @@ class SingledispatchMethodDocumenter(MethodDocumenter): Retained for backwards compatibility, now does the same as the MethodDocumenter """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + warnings.warn("%s is deprecated." % self.__class__.__name__, + RemovedInSphinx50Warning, stacklevel=2) + super().__init__(*args, **kwargs) + class AttributeDocumenter(DocstringStripSignatureMixin, ClassLevelDocumenter): # type: ignore """ |