Skip to content

Commit

Permalink
Fix type annotations for tuple parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost authored and DanielNoord committed Sep 5, 2024
1 parent 6deb34f commit 1495979
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions astroid/interpreter/_import/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, path: Sequence[str] | None = None) -> None:
@abc.abstractmethod
def find_module(
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> ModuleSpec | None:
Expand Down Expand Up @@ -129,7 +129,7 @@ class ImportlibFinder(Finder):
@staticmethod
def find_module(
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> ModuleSpec | None:
Expand Down Expand Up @@ -224,7 +224,7 @@ class ExplicitNamespacePackageFinder(ImportlibFinder):
@staticmethod
def find_module(
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> ModuleSpec | None:
Expand Down Expand Up @@ -264,7 +264,7 @@ def __init__(self, path: Sequence[str]) -> None:
@staticmethod
def find_module(
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> ModuleSpec | None:
Expand All @@ -288,7 +288,7 @@ class PathSpecFinder(Finder):
@staticmethod
def find_module(
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> ModuleSpec | None:
Expand Down Expand Up @@ -342,7 +342,7 @@ def _get_zipimporters() -> Iterator[tuple[str, zipimport.zipimporter]]:


def _search_zip(
modpath: tuple[str],
modpath: tuple[str, ...],
) -> tuple[Literal[ModuleType.PY_ZIPMODULE], str, str]:
for filepath, importer in _get_zipimporters():
if PY310_PLUS:
Expand Down Expand Up @@ -372,7 +372,7 @@ def _search_zip(
def _find_spec_with_path(
search_path: Sequence[str],
modname: str,
module_parts: tuple[str],
module_parts: tuple[str, ...],
processed: tuple[str, ...],
submodule_path: Sequence[str] | None,
) -> tuple[Finder | _MetaPathFinder, ModuleSpec]:
Expand Down Expand Up @@ -444,7 +444,9 @@ def find_spec(modpath: Iterable[str], path: Iterable[str] | None = None) -> Modu


@lru_cache(maxsize=1024)
def _find_spec(module_path: tuple[str], path: tuple[str, ...]) -> ModuleSpec:
def _find_spec(
module_path: tuple[str, ...], path: tuple[str, ...] | None
) -> ModuleSpec:
_path = path or sys.path

# Need a copy for not mutating the argument.
Expand Down

0 comments on commit 1495979

Please sign in to comment.