@@ -90,7 +90,7 @@ def __init__(self, path: Sequence[str] | None = None) -> None:
90
90
@abc .abstractmethod
91
91
def find_module (
92
92
modname : str ,
93
- module_parts : Sequence [str ],
93
+ module_parts : tuple [str ],
94
94
processed : list [str ],
95
95
submodule_path : Sequence [str ] | None ,
96
96
) -> ModuleSpec | None :
@@ -100,7 +100,7 @@ def find_module(
100
100
they all return a ModuleSpec.
101
101
102
102
:param modname: The module which needs to be searched.
103
- :param module_parts: It should be a list of strings,
103
+ :param module_parts: It should be a tuple of strings,
104
104
where each part contributes to the module's
105
105
namespace.
106
106
:param processed: What parts from the module parts were processed
@@ -129,7 +129,7 @@ class ImportlibFinder(Finder):
129
129
@staticmethod
130
130
def find_module (
131
131
modname : str ,
132
- module_parts : Sequence [str ],
132
+ module_parts : tuple [str ],
133
133
processed : list [str ],
134
134
submodule_path : Sequence [str ] | None ,
135
135
) -> ModuleSpec | None :
@@ -224,7 +224,7 @@ class ExplicitNamespacePackageFinder(ImportlibFinder):
224
224
@staticmethod
225
225
def find_module (
226
226
modname : str ,
227
- module_parts : Sequence [str ],
227
+ module_parts : tuple [str ],
228
228
processed : list [str ],
229
229
submodule_path : Sequence [str ] | None ,
230
230
) -> ModuleSpec | None :
@@ -264,7 +264,7 @@ def __init__(self, path: Sequence[str]) -> None:
264
264
@staticmethod
265
265
def find_module (
266
266
modname : str ,
267
- module_parts : Sequence [str ],
267
+ module_parts : tuple [str ],
268
268
processed : list [str ],
269
269
submodule_path : Sequence [str ] | None ,
270
270
) -> ModuleSpec | None :
@@ -288,7 +288,7 @@ class PathSpecFinder(Finder):
288
288
@staticmethod
289
289
def find_module (
290
290
modname : str ,
291
- module_parts : Sequence [str ],
291
+ module_parts : tuple [str ],
292
292
processed : list [str ],
293
293
submodule_path : Sequence [str ] | None ,
294
294
) -> ModuleSpec | None :
@@ -342,7 +342,7 @@ def _get_zipimporters() -> Iterator[tuple[str, zipimport.zipimporter]]:
342
342
343
343
344
344
def _search_zip (
345
- modpath : Sequence [str ],
345
+ modpath : tuple [str ],
346
346
) -> tuple [Literal [ModuleType .PY_ZIPMODULE ], str , str ]:
347
347
for filepath , importer in _get_zipimporters ():
348
348
if PY310_PLUS :
@@ -372,7 +372,7 @@ def _search_zip(
372
372
def _find_spec_with_path (
373
373
search_path : Sequence [str ],
374
374
modname : str ,
375
- module_parts : list [str ],
375
+ module_parts : tuple [str ],
376
376
processed : list [str ],
377
377
submodule_path : Sequence [str ] | None ,
378
378
) -> tuple [Finder | _MetaPathFinder , ModuleSpec ]:
@@ -451,7 +451,7 @@ def _find_spec(module_path: tuple, path: tuple) -> ModuleSpec:
451
451
modpath = list (module_path )
452
452
453
453
submodule_path = None
454
- module_parts = modpath [:]
454
+ module_parts = tuple ( modpath )
455
455
processed : list [str ] = []
456
456
457
457
while modpath :
0 commit comments