mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
Let open() take a pathlib.Path starting in 3.6 (#596)
This commit is contained in:
committed by
Guido van Rossum
parent
8d10e885d1
commit
1b9266d801
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user