diff --git a/stdlib/3/fileinput.pyi b/stdlib/3/fileinput.pyi index 3f0179216..7d68c2797 100644 --- a/stdlib/3/fileinput.pyi +++ b/stdlib/3/fileinput.pyi @@ -1,16 +1,13 @@ -from typing import Iterable, Callable, IO, AnyStr, Generic, Any, TypeVar - -StrOrIterableStr = TypeVar('StrOrIterableStr', str, Iterable[str]) +from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Union, Iterator def input( - files: StrOrIterableStr=None, + files: Union[str, Iterable[str]]=None, inplace: bool=..., backup: str=..., bufsize: int=..., mode: str=..., - openhook: Callable[[str, str], IO[AnyStr]]=... - ): ... + openhook: Callable[[str, str], IO[AnyStr]]=...) -> Iterable[AnyStr]: ... def close() -> None: ... @@ -23,7 +20,7 @@ def isstdin() -> bool: ... class FileInput(Iterable[AnyStr], Generic[AnyStr]): def __init__( self, - files: StrOrIterableStr=None, + files: Union[str, Iterable[str]]=None, inplace: bool=..., backup: str=..., bufsize: int=..., @@ -33,13 +30,13 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]): def __del__(self) -> None: ... def close(self) -> None: ... - def __enter__(self): ... + def __enter__(self) -> 'FileInput[AnyStr]': ... def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... - def __iter__(self): ... - def __next__(self) -> str: ... - def __getitem__(self, i) -> str: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __next__(self) -> AnyStr: ... + def __getitem__(self, i) -> AnyStr: ... def nextfile(self) -> None: ... - def readline(self) -> str: ... + def readline(self) -> AnyStr: ... def filename(self) -> str: ... def lineno(self) -> int: ... def filelineno(self) -> int: ...