Skip to content

Commit

Permalink
MAINT: Fix some types (#1779)
Browse files Browse the repository at this point in the history
It look like one type annotation was incorrect
  • Loading branch information
Carreau committed Apr 25, 2024
1 parent a4eaf77 commit cd064bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pydata_sphinx_theme/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import copy
import os
import re
from typing import Any, Dict, Iterator, List, Optional, Union
from typing import Any, Callable, Dict, Iterable, List, Optional, Union

from docutils.nodes import Node
from sphinx.application import Sphinx
Expand Down Expand Up @@ -32,7 +32,9 @@ def config_provided_by_user(app: Sphinx, key: str) -> bool:
return any(key in ii for ii in [app.config.overrides, app.config._raw_config])


def traverse_or_findall(node: Node, condition: str, **kwargs) -> Iterator[Node]:
def traverse_or_findall(
node: Node, condition: Union[Callable, type], **kwargs
) -> Iterable[Node]:
"""Triage node.traverse (docutils <0.18.1) vs node.findall.
TODO: This check can be removed when the minimum supported docutils version
Expand Down

0 comments on commit cd064bd

Please sign in to comment.