summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r--sphinx/domains/python.py25
1 files changed, 4 insertions, 21 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 6076eb7fb..6a6c447b5 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -5,7 +5,6 @@ import inspect
import re
import sys
import typing
-import warnings
from inspect import Parameter
from typing import Any, Dict, Iterable, Iterator, List, NamedTuple, Optional, Tuple, Type, cast
@@ -18,7 +17,6 @@ from sphinx import addnodes
from sphinx.addnodes import desc_signature, pending_xref, pending_xref_condition
from sphinx.application import Sphinx
from sphinx.builders import Builder
-from sphinx.deprecation import RemovedInSphinx60Warning
from sphinx.directives import ObjectDescription
from sphinx.domains import Domain, Index, IndexEntry, ObjType
from sphinx.environment import BuildEnvironment
@@ -512,14 +510,10 @@ class PyObject(ObjectDescription[Tuple[str, str]]):
sig_prefix = self.get_signature_prefix(sig)
if sig_prefix:
if type(sig_prefix) is str:
- warnings.warn(
+ raise TypeError(
"Python directive method get_signature_prefix()"
- " returning a string is deprecated."
- " It must now return a list of nodes."
- " Return value was '{}'.".format(sig_prefix),
- RemovedInSphinx60Warning)
- signode += addnodes.desc_annotation(sig_prefix, '', # type: ignore
- nodes.Text(sig_prefix)) # type: ignore
+ " must return a list of nodes."
+ f" Return value was '{sig_prefix}'.")
else:
signode += addnodes.desc_annotation(str(sig_prefix), '', *sig_prefix)
@@ -803,15 +797,11 @@ class PyMethod(PyObject):
'async': directives.flag,
'classmethod': directives.flag,
'final': directives.flag,
- 'property': directives.flag,
'staticmethod': directives.flag,
})
def needs_arglist(self) -> bool:
- if 'property' in self.options:
- return False
- else:
- return True
+ return True
def get_signature_prefix(self, sig: str) -> List[nodes.Node]:
prefix: List[nodes.Node] = []
@@ -827,11 +817,6 @@ class PyMethod(PyObject):
if 'classmethod' in self.options:
prefix.append(nodes.Text('classmethod'))
prefix.append(addnodes.desc_sig_space())
- if 'property' in self.options:
- logger.warning(_('Using the :property: flag with the py:method directive'
- 'is deprecated, use ".. py:property::" instead.'))
- prefix.append(nodes.Text('property'))
- prefix.append(addnodes.desc_sig_space())
if 'staticmethod' in self.options:
prefix.append(nodes.Text('static'))
prefix.append(addnodes.desc_sig_space())
@@ -851,8 +836,6 @@ class PyMethod(PyObject):
if 'classmethod' in self.options:
return _('%s() (%s class method)') % (methname, clsname)
- elif 'property' in self.options:
- return _('%s (%s property)') % (methname, clsname)
elif 'staticmethod' in self.options:
return _('%s() (%s static method)') % (methname, clsname)
else: