diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-04-07 21:58:15 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-04-07 22:41:10 +0900 |
| commit | b0b3f5a677162f97f7e0fb62428fa09468b0f23c (patch) | |
| tree | 68187d274406ade9c420d2136588aaa5498aad24 | |
| parent | fcc964b66f9f5e36c0ea023d24e48072b34dfb7d (diff) | |
| download | sphinx-git-b0b3f5a677162f97f7e0fb62428fa09468b0f23c.tar.gz | |
deprecate PyClassmember class
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | doc/extdev/deprecated.rst | 8 | ||||
| -rw-r--r-- | sphinx/domains/python.py | 12 |
3 files changed, 20 insertions, 1 deletions
@@ -33,6 +33,7 @@ Deprecated * ``sphinx.directives.TabularColumns`` * ``sphinx.directives.TocTree`` * ``sphinx.directives.VersionChange`` +* ``sphinx.domains.python.PyClassmember`` * ``sphinx.domains.std.StandardDomain._resolve_citation_xref()`` * ``sphinx.domains.std.StandardDomain.note_citations()`` * ``sphinx.domains.std.StandardDomain.note_citation_refs()`` diff --git a/doc/extdev/deprecated.rst b/doc/extdev/deprecated.rst index beeafab08..ffe0bdccb 100644 --- a/doc/extdev/deprecated.rst +++ b/doc/extdev/deprecated.rst @@ -116,6 +116,14 @@ The following is a list of deprecated interfaces. - 4.0 - ``sphinx.directives.other.VersionChange`` + * - ``sphinx.domains.python.PyClassmember`` + - 2.1 + - 4.0 + - ``sphinx.domains.python.PyAttribute``, + ``sphinx.domains.python.PyMethod``, + ``sphinx.domains.python.PyClassMethod`` and + ``sphinx.domains.python.PyStaticMethod`` + * - ``sphinx.domains.std.StandardDomain._resolve_citation_xref()`` - 2.1 - 4.0 diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index c7e9e1b68..de31eef00 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -9,13 +9,16 @@ """ import re +import warnings from typing import cast from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes, locale -from sphinx.deprecation import DeprecatedDict, RemovedInSphinx30Warning +from sphinx.deprecation import ( + DeprecatedDict, RemovedInSphinx30Warning, RemovedInSphinx40Warning +) from sphinx.directives import ObjectDescription from sphinx.domains import Domain, ObjType, Index, IndexEntry from sphinx.locale import _, __ @@ -453,6 +456,13 @@ class PyClassmember(PyObject): Description of a class member (methods, attributes). """ + def run(self): + # type: () -> List[nodes.Node] + warnings.warn('PyClassmember is deprecated.', + RemovedInSphinx40Warning) + + return super().run() + def needs_arglist(self): # type: () -> bool return self.objtype.endswith('method') |
