summaryrefslogtreecommitdiff
path: root/sphinx/builders/epub3.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/builders/epub3.py')
-rw-r--r--sphinx/builders/epub3.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py
index 5d7121fe6..7caac74d3 100644
--- a/sphinx/builders/epub3.py
+++ b/sphinx/builders/epub3.py
@@ -11,9 +11,8 @@
import html
import warnings
-from collections import namedtuple
from os import path
-from typing import Any, Dict, List, Set, Tuple
+from typing import Any, Dict, List, NamedTuple, Set, Tuple
from sphinx import package_dir
from sphinx.application import Sphinx
@@ -29,7 +28,12 @@ from sphinx.util.osutil import make_filename
logger = logging.getLogger(__name__)
-NavPoint = namedtuple('NavPoint', ['text', 'refuri', 'children'])
+class NavPoint(NamedTuple):
+ text: str
+ refuri: str
+ children: List[Any] # mypy does not support recursive types
+ # https://github.com/python/mypy/issues/7069
+
# writing modes
PAGE_PROGRESSION_DIRECTIONS = {