From f264eda4ed27e5329f7a8a897930a4c9a089009b Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 4 Jul 2017 19:20:45 -0700 Subject: [PATCH] builtins: mode argument to open can be unicode (#1452) Part of #1411 Also remove some explicit parameter defaults. --- stdlib/2/__builtin__.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index bb2eb3a21..35ccf90ba 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -750,14 +750,14 @@ def next(i: Iterator[_T]) -> _T: ... def next(i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... def oct(i: int) -> str: ... # TODO __index__ @overload -def open(file: str, mode: str = 'r', buffering: int = ...) -> BinaryIO: ... +def open(file: str, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... @overload -def open(file: unicode, mode: str = 'r', buffering: int = ...) -> BinaryIO: ... +def open(file: unicode, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... @overload -def open(file: int, mode: str = 'r', buffering: int = ...) -> BinaryIO: ... +def open(file: int, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... def ord(c: unicode) -> int: ... # This is only available after from __future__ import print_function. -def print(*values: Any, sep: unicode = u' ', end: unicode = u'\n', +def print(*values: Any, sep: unicode = ..., end: unicode = ..., file: IO[Any] = ...) -> None: ... @overload def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y. @@ -768,7 +768,7 @@ def pow(x: float, y: float) -> float: ... @overload def pow(x: float, y: float, z: float) -> float: ... def quit(code: int = ...) -> None: ... -def range(x: int, y: int = 0, step: int = 1) -> List[int]: ... +def range(x: int, y: int = ..., step: int = ...) -> List[int]: ... def raw_input(prompt: Any = ...) -> str: ... @overload