Merge pull request #991 from JetBrains/sproshev/pep-519

Update `open`, `os.fspath`, `os.fsencode`, `os.fsdecode`, `pathlib.PurePath` and `pathlib.Path` stubs due to PEP-519
This commit is contained in:
Jelle Zijlstra
2017-03-21 07:38:50 -07:00
committed by GitHub
3 changed files with 29 additions and 7 deletions

View File

@@ -22,8 +22,10 @@ class PurePath(_PurePathBase):
stem = ... # type: str
if sys.version_info < (3, 5):
def __init__(self, *pathsegments: str) -> None: ...
else:
elif sys.version_info < (3, 6):
def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ...
else:
def __new__(cls: Type[_P], *args: Union[str, os.PathLike]) -> _P: ...
def __hash__(self) -> int: ...
def __lt__(self, other: PurePath) -> bool: ...
def __le__(self, other: PurePath) -> bool: ...
@@ -93,8 +95,12 @@ class Path(PurePath):
if sys.version_info >= (3, 5):
@classmethod
def home(cls: Type[_P]) -> _P: ...
def __new__(cls: Type[_P], *args: Union[str, PurePath],
**kwargs: Any) -> _P: ...
if sys.version_info < (3, 6):
def __new__(cls: Type[_P], *args: Union[str, PurePath],
**kwargs: Any) -> _P: ...
else:
def __new__(cls: Type[_P], *args: Union[str, os.PathLike],
**kwargs: Any) -> _P: ...
def absolute(self: _P) -> _P: ...
def expanduser(self: _P) -> _P: ...