diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 52132022d14..980fd47a790 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -700,7 +700,7 @@ def depart_desc(self, node: Element) -> None: self.body.append(CR + r'\end{fulllineitems}' + BLANKLINE) def _visit_signature_line(self, node: Element) -> None: - def next_sibling(e: Element) -> Element | None: + def next_sibling(e: Node) -> Node | None: try: return e.parent[e.parent.index(e) + 1] except (AttributeError, IndexError): diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index 7a25c2bfade..f2c327de106 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -397,7 +397,7 @@ def __init__(self, document: nodes.document, builder: TextBuilder) -> None: Used by visit_* and depart_* functions in conjunction with the tree traversal. Make sure that the pops correspond to the pushes. """ - self.context = [] + self.context: list[str] = [] def add_text(self, text: str) -> None: self.states[-1].append((-1, text))