Skip to content

Commit 75723e3

Browse files
ilevkivskyisrittau
authored andcommitted
Add an optional opener parameter to open() function (#2977)
Fixes #2976
1 parent c031002 commit 75723e3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

stdlib/2/__builtin__.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,10 +1315,12 @@ def oct(__i: int) -> str: ... # TODO __index__
13151315

13161316
if sys.version_info >= (3, 6):
13171317
def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
1318-
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
1318+
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
1319+
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
13191320
elif sys.version_info >= (3,):
13201321
def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
1321-
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
1322+
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
1323+
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
13221324
else:
13231325
def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...
13241326

stdlib/2and3/builtins.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,10 +1315,12 @@ def oct(__i: int) -> str: ... # TODO __index__
13151315

13161316
if sys.version_info >= (3, 6):
13171317
def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
1318-
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
1318+
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
1319+
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
13191320
elif sys.version_info >= (3,):
13201321
def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
1321-
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
1322+
errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...,
1323+
opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ...
13221324
else:
13231325
def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...
13241326

0 commit comments

Comments
 (0)