summaryrefslogtreecommitdiff
path: root/sphinx/util/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/typing.py')
-rw-r--r--sphinx/util/typing.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
index 2ac03c916..e0cf0104b 100644
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -9,7 +9,7 @@
:license: BSD, see LICENSE for details.
"""
-from typing import Callable, Dict, List, Tuple
+from typing import Callable, Dict, List, Tuple, TypeVar
from docutils import nodes
from docutils.parsers.rst.states import Inliner
@@ -24,6 +24,9 @@ else:
unicode = str
+N_co = TypeVar('N_co', bound=nodes.Node, covariant=True)
+
+
# common role functions
RoleFunction = Callable[[text_type, text_type, text_type, int, Inliner, Dict, List[text_type]],
Tuple[List[nodes.Node], List[nodes.system_message]]]