mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix type of imp.find_module() (#3465)
find_module is documented to return a tuple (file, pathname,
description) where "file" is open file object and "description" a tuple
(suffix, mode, type). The type of "file" was wrong ("str" instead of
"IO[Any]") as well as that of "suffix" ("IO[Any]" instead of "str");
probably those type definitions were swapped.
Fixes #3466.
This commit is contained in:
committed by
Jukka Lehtosalo
parent
34d68ab0a2
commit
838e02334e
@@ -15,7 +15,7 @@ PY_SOURCE: int
|
||||
SEARCH_ERROR: int
|
||||
|
||||
def acquire_lock() -> None: ...
|
||||
def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ...
|
||||
def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[IO[Any], str, Tuple[str, str, int]]]: ...
|
||||
def get_magic() -> str: ...
|
||||
def get_suffixes() -> List[Tuple[str, str, int]]: ...
|
||||
def init_builtin(name: str) -> types.ModuleType: ...
|
||||
|
||||
@@ -46,9 +46,9 @@ def load_compiled(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> ty
|
||||
def load_package(name: str, path: _Path) -> types.ModuleType: ...
|
||||
def load_module(name: str, file: IO[Any], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ...
|
||||
def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ...
|
||||
else:
|
||||
def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[str, str, Tuple[IO[Any], str, int]]: ...
|
||||
def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ...
|
||||
def reload(module: types.ModuleType) -> types.ModuleType: ...
|
||||
def init_builtin(name: str) -> Optional[types.ModuleType]: ...
|
||||
def load_dynamic(name: str, path: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ...
|
||||
|
||||
Reference in New Issue
Block a user