From 75723e38857f2db828f990a2021ede3cc07674a2 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Thu, 9 May 2019 15:59:32 +0100 Subject: [PATCH] Add an optional opener parameter to open() function (#2977) Fixes #2976 --- stdlib/2/__builtin__.pyi | 6 ++++-- stdlib/2and3/builtins.pyi | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index a4d6b0362..8ac0056f9 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -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: ... diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index a4d6b0362..8ac0056f9 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -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: ...