mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
committed by
Sebastian Rittau
parent
b9101e9c5e
commit
e4a9cd580c
@@ -2,7 +2,7 @@ import importlib.abc
|
||||
import importlib.machinery
|
||||
import sys
|
||||
import types
|
||||
from typing import Any, Callable, List, Optional
|
||||
from typing import Any, Callable, List, Optional, Union
|
||||
|
||||
def module_for_loader(
|
||||
fxn: Callable[..., types.ModuleType]
|
||||
@@ -30,8 +30,15 @@ def spec_from_loader(
|
||||
origin: Optional[str] = ..., loader_state: Optional[Any] = ...,
|
||||
is_package: Optional[bool] = ...
|
||||
) -> importlib.machinery.ModuleSpec: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
import os
|
||||
_Path = Union[str, bytes, os.PathLike]
|
||||
else:
|
||||
_Path = str
|
||||
|
||||
def spec_from_file_location(
|
||||
name: str, location: str, *,
|
||||
name: str, location: _Path, *,
|
||||
loader: Optional[importlib.abc.Loader] = ...,
|
||||
submodule_search_locations: Optional[List[str]] = ...
|
||||
) -> importlib.machinery.ModuleSpec: ...
|
||||
|
||||
Reference in New Issue
Block a user