diff --git a/CHANGES b/CHANGES index e4f45c12f..6434cc3a7 100644 --- a/CHANGES +++ b/CHANGES @@ -62,7 +62,8 @@ Deprecated * ``sphinx.testing.util.remove_unicode_literal()`` * ``sphinx.util.attrdict`` * ``sphinx.util.force_decode()`` -* ``sphinx.util.get_matching_docs()`` is deprecated +* ``sphinx.util.get_matching_docs()`` +* ``sphinx.util.inspect.Parameter`` * ``sphinx.util.osutil.walk()`` * ``sphinx.util.PeekableIterator`` * ``sphinx.util.pycompat.u`` diff --git a/doc/extdev/index.rst b/doc/extdev/index.rst index 4dc9f9480..003666217 100644 --- a/doc/extdev/index.rst +++ b/doc/extdev/index.rst @@ -202,6 +202,11 @@ The following is a list of deprecated interfaces. - 4.0 - ``sphinx.util.get_matching_files()`` + * - ``sphinx.util.inspect.Parameter`` + - 2.0 + - 3.0 + - N/A + * - ``sphinx.util.osutil.walk()`` - 2.0 - 4.0 diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index eeedf77ab..eebcbc7b8 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -16,10 +16,12 @@ import inspect import re import sys import typing +import warnings from functools import partial from six import StringIO +from sphinx.deprecation import RemovedInSphinx30Warning from sphinx.util import logging from sphinx.util.pycompat import NoneType @@ -289,6 +291,9 @@ class Parameter: self.default = default self.annotation = self.empty + warnings.warn('sphinx.util.inspect.Parameter is deprecated.', + RemovedInSphinx30Warning, stacklevel=2) + class Signature: """The Signature object represents the call signature of a callable object and