Skip to content

Commit 1495979

Browse files
correctmostDanielNoord
authored andcommitted
Fix type annotations for tuple parameters
1 parent 6deb34f commit 1495979

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

astroid/interpreter/_import/spec.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self, path: Sequence[str] | None = None) -> None:
9090
@abc.abstractmethod
9191
def find_module(
9292
modname: str,
93-
module_parts: tuple[str],
93+
module_parts: tuple[str, ...],
9494
processed: tuple[str, ...],
9595
submodule_path: Sequence[str] | None,
9696
) -> ModuleSpec | None:
@@ -129,7 +129,7 @@ class ImportlibFinder(Finder):
129129
@staticmethod
130130
def find_module(
131131
modname: str,
132-
module_parts: tuple[str],
132+
module_parts: tuple[str, ...],
133133
processed: tuple[str, ...],
134134
submodule_path: Sequence[str] | None,
135135
) -> ModuleSpec | None:
@@ -224,7 +224,7 @@ class ExplicitNamespacePackageFinder(ImportlibFinder):
224224
@staticmethod
225225
def find_module(
226226
modname: str,
227-
module_parts: tuple[str],
227+
module_parts: tuple[str, ...],
228228
processed: tuple[str, ...],
229229
submodule_path: Sequence[str] | None,
230230
) -> ModuleSpec | None:
@@ -264,7 +264,7 @@ def __init__(self, path: Sequence[str]) -> None:
264264
@staticmethod
265265
def find_module(
266266
modname: str,
267-
module_parts: tuple[str],
267+
module_parts: tuple[str, ...],
268268
processed: tuple[str, ...],
269269
submodule_path: Sequence[str] | None,
270270
) -> ModuleSpec | None:
@@ -288,7 +288,7 @@ class PathSpecFinder(Finder):
288288
@staticmethod
289289
def find_module(
290290
modname: str,
291-
module_parts: tuple[str],
291+
module_parts: tuple[str, ...],
292292
processed: tuple[str, ...],
293293
submodule_path: Sequence[str] | None,
294294
) -> ModuleSpec | None:
@@ -342,7 +342,7 @@ def _get_zipimporters() -> Iterator[tuple[str, zipimport.zipimporter]]:
342342

343343

344344
def _search_zip(
345-
modpath: tuple[str],
345+
modpath: tuple[str, ...],
346346
) -> tuple[Literal[ModuleType.PY_ZIPMODULE], str, str]:
347347
for filepath, importer in _get_zipimporters():
348348
if PY310_PLUS:
@@ -372,7 +372,7 @@ def _search_zip(
372372
def _find_spec_with_path(
373373
search_path: Sequence[str],
374374
modname: str,
375-
module_parts: tuple[str],
375+
module_parts: tuple[str, ...],
376376
processed: tuple[str, ...],
377377
submodule_path: Sequence[str] | None,
378378
) -> tuple[Finder | _MetaPathFinder, ModuleSpec]:
@@ -444,7 +444,9 @@ def find_spec(modpath: Iterable[str], path: Iterable[str] | None = None) -> Modu
444444

445445

446446
@lru_cache(maxsize=1024)
447-
def _find_spec(module_path: tuple[str], path: tuple[str, ...]) -> ModuleSpec:
447+
def _find_spec(
448+
module_path: tuple[str, ...], path: tuple[str, ...] | None
449+
) -> ModuleSpec:
448450
_path = path or sys.path
449451

450452
# Need a copy for not mutating the argument.

0 commit comments

Comments
 (0)