Add an optional opener parameter to open() function (#2977)

Fixes #2976
This commit is contained in:
Ivan Levkivskyi
2019-05-09 15:59:32 +01:00
committed by Sebastian Rittau
parent c03100230d
commit 75723e3885
2 changed files with 8 additions and 4 deletions

View File

@@ -1315,10 +1315,12 @@ def oct(__i: int) -> str: ... # TODO __index__
if sys.version_info >= (3, 6):
def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
elif sys.version_info >= (3,):
def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
else:
def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...