Let open() take a pathlib.Path starting in 3.6 (#596)

This commit is contained in:
jgarvin
2016-10-13 18:17:39 -05:00
committed by Guido van Rossum
parent 8d10e885d1
commit 1b9266d801

View File

@@ -703,8 +703,15 @@ def next(i: Iterator[_T]) -> _T: ...
@overload
def next(i: Iterator[_T], default: _T) -> _T: ...
def oct(i: int) -> str: ... # TODO __index__
def open(file: Union[str, bytes, int], mode: str = 'r', buffering: int = -1, encoding: str = None,
errors: str = None, newline: str = None, closefd: bool = ...) -> IO[Any]: ...
if sys.version_info >= (3, 6):
from pathlib import Path
def open(file: Union[str, bytes, int, Path], mode: str = 'r', buffering: int = -1, encoding: str = None,
errors: str = None, newline: str = None, closefd: bool = ...) -> IO[Any]: ...
else:
def open(file: Union[str, bytes, int], mode: str = 'r', buffering: int = -1, encoding: str = None,
errors: str = None, newline: str = None, closefd: bool = ...) -> IO[Any]: ...
def ord(c: Union[str, bytes, bytearray]) -> int: ...
# TODO: in Python 3.2, print() does not support flush
def print(*values: Any, sep: str = ' ', end: str = '\n', file: IO[str] = None, flush: bool = False) -> None: ...