Update stubs for pathlib.PurePath and pathlib.Path classes due to PEP-519.

This commit is contained in:
Semyon Proshev
2017-03-13 18:35:50 +03:00
parent 10860386d8
commit e4fdd0eb62

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: ...