diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-03 16:48:51 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-03 16:50:38 +0300 |
commit | bad2444ed516f1a4454b6b735905cfc5f04abae9 (patch) | |
tree | c97d245bb7489da3a804a4c4fc52fe15bec07a38 /sphinx/domains | |
parent | 1b7d16505ea6e77586c6c4f4afc15a3e73116d80 (diff) |
refactor: Update typehints for ObjectDescription using Generic
Diffstat (limited to 'sphinx/domains')
-rw-r--r-- | sphinx/domains/c.py | 2 | ||||
-rw-r--r-- | sphinx/domains/cpp.py | 2 | ||||
-rw-r--r-- | sphinx/domains/javascript.py | 2 | ||||
-rw-r--r-- | sphinx/domains/python.py | 2 | ||||
-rw-r--r-- | sphinx/domains/rst.py | 2 | ||||
-rw-r--r-- | sphinx/domains/std.py | 4 |
6 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index 87f115c4a..fb4da502d 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -3099,7 +3099,7 @@ def _make_phony_error_name() -> ASTNestedName: return ASTNestedName([ASTIdentifier("PhonyNameDueToError")], rooted=False) -class CObject(ObjectDescription): +class CObject(ObjectDescription[ASTDeclaration]): """ Description of a C language object. """ diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 389630a32..f6e746809 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6670,7 +6670,7 @@ def _make_phony_error_name() -> ASTNestedName: return ASTNestedName([nne], [False], rooted=False) -class CPPObject(ObjectDescription): +class CPPObject(ObjectDescription[ASTDeclaration]): """Description of a C++ language object.""" doc_field_types = [ diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py index a4b2eca2e..f612fb914 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -32,7 +32,7 @@ from sphinx.util.nodes import make_id, make_refnode logger = logging.getLogger(__name__) -class JSObject(ObjectDescription): +class JSObject(ObjectDescription[Tuple[str, str]]): """ Description of a JavaScript object. """ diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index dff4f9580..c2af9886f 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -334,7 +334,7 @@ class PyTypedField(PyXrefMixin, TypedField): return super().make_xref(rolename, domain, target, innernode, contnode, env) -class PyObject(ObjectDescription): +class PyObject(ObjectDescription[Tuple[str, str]]): """ Description of a general Python object. diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py index 0539197bc..07bf46b75 100644 --- a/sphinx/domains/rst.py +++ b/sphinx/domains/rst.py @@ -31,7 +31,7 @@ logger = logging.getLogger(__name__) dir_sig_re = re.compile(r'\.\. (.+?)::(.*)$') -class ReSTMarkup(ObjectDescription): +class ReSTMarkup(ObjectDescription[str]): """ Description of generic reST markup. """ diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index bdce2406e..33acdb3f5 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -48,7 +48,7 @@ option_desc_re = re.compile(r'((?:/|--|-|\+)?[^\s=]+)(=?\s*.*)') token_re = re.compile(r'`(\w+)`', re.U) -class GenericObject(ObjectDescription): +class GenericObject(ObjectDescription[str]): """ A generic x-ref directive registered with Sphinx.add_object_type(). """ @@ -178,7 +178,7 @@ class Target(SphinxDirective): return self.name + '-' + name -class Cmdoption(ObjectDescription): +class Cmdoption(ObjectDescription[str]): """ Description of a command-line option (.. option). """ |