From 2eaf1933b850039760af5e0cc4df01d23281508c Mon Sep 17 00:00:00 2001 From: Julien Hebert Date: Tue, 22 Mar 2016 08:38:08 +0100 Subject: [PATCH] files is optional --- stdlib/3/fileinput.pyi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stdlib/3/fileinput.pyi b/stdlib/3/fileinput.pyi index ff64c40e0..3f0179216 100644 --- a/stdlib/3/fileinput.pyi +++ b/stdlib/3/fileinput.pyi @@ -1,8 +1,10 @@ -from typing import Iterable, BinaryIO, List, Callable, IO, AnyStr, Generic +from typing import Iterable, Callable, IO, AnyStr, Generic, Any, TypeVar + +StrOrIterableStr = TypeVar('StrOrIterableStr', str, Iterable[str]) def input( - files: List[str]=..., + files: StrOrIterableStr=None, inplace: bool=..., backup: str=..., bufsize: int=..., @@ -21,7 +23,7 @@ def isstdin() -> bool: ... class FileInput(Iterable[AnyStr], Generic[AnyStr]): def __init__( self, - files: List[str]=..., + files: StrOrIterableStr=None, inplace: bool=..., backup: str=..., bufsize: int=..., @@ -32,7 +34,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]): def __del__(self) -> None: ... def close(self) -> None: ... def __enter__(self): ... - def __exit__(self, type, value, traceback) -> None: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... def __iter__(self): ... def __next__(self) -> str: ... def __getitem__(self, i) -> str: ...