diff --git a/stdlib/2/os/path.pyi b/stdlib/2/os/path.pyi index 73c14de70..76a4c4b8d 100644 --- a/stdlib/2/os/path.pyi +++ b/stdlib/2/os/path.pyi @@ -5,6 +5,7 @@ import os import sys from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from genericpath import exists as exists _T = TypeVar('_T') @@ -100,10 +101,6 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(m: Sequence[_PathType]) -> Any: ... -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True, diff --git a/stdlib/2/os2emxpath.pyi b/stdlib/2/os2emxpath.pyi index 73c14de70..76a4c4b8d 100644 --- a/stdlib/2/os2emxpath.pyi +++ b/stdlib/2/os2emxpath.pyi @@ -5,6 +5,7 @@ import os import sys from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from genericpath import exists as exists _T = TypeVar('_T') @@ -100,10 +101,6 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(m: Sequence[_PathType]) -> Any: ... -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True, diff --git a/stdlib/2and3/genericpath.pyi b/stdlib/2and3/genericpath.pyi index e0b1c6de2..aba0788a5 100644 --- a/stdlib/2and3/genericpath.pyi +++ b/stdlib/2and3/genericpath.pyi @@ -1,12 +1,15 @@ -from typing import Sequence, AnyStr, Text +from typing import Sequence, AnyStr, Text, Union import sys if sys.version_info >= (3, 0): def commonprefix(m: Sequence[str]) -> str: ... else: def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... - -def exists(path: Text) -> bool: ... +if sys.version_info >= (3, 6): + from os import PathLike + def exists(path: Union[AnyStr, PathLike[AnyStr]]) -> bool: ... +else: + def exists(path: Text) -> bool: ... def isfile(path: Text) -> bool: ... def isdir(s: Text) -> bool: ... def getsize(filename: Text) -> int: ... diff --git a/stdlib/2and3/ntpath.pyi b/stdlib/2and3/ntpath.pyi index 73c14de70..76a4c4b8d 100644 --- a/stdlib/2and3/ntpath.pyi +++ b/stdlib/2and3/ntpath.pyi @@ -5,6 +5,7 @@ import os import sys from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from genericpath import exists as exists _T = TypeVar('_T') @@ -100,10 +101,6 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(m: Sequence[_PathType]) -> Any: ... -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True, diff --git a/stdlib/2and3/posixpath.pyi b/stdlib/2and3/posixpath.pyi index 73c14de70..76a4c4b8d 100644 --- a/stdlib/2and3/posixpath.pyi +++ b/stdlib/2and3/posixpath.pyi @@ -5,6 +5,7 @@ import os import sys from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from genericpath import exists as exists _T = TypeVar('_T') @@ -100,10 +101,6 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(m: Sequence[_PathType]) -> Any: ... -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True, diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index 73c14de70..76a4c4b8d 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -5,6 +5,7 @@ import os import sys from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from genericpath import exists as exists _T = TypeVar('_T') @@ -100,10 +101,6 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(m: Sequence[_PathType]) -> Any: ... -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True,