@@ -17,6 +17,11 @@ if sys.version_info >= (3, 6):
1717else :
1818 _PathType = Union [bytes , Text ]
1919
20+ if sys .version_info >= (3 , 3 ):
21+ _FdOrPathType = Union [int , _PathType ]
22+ else :
23+ _FdOrPathType = _PathType
24+
2025# ----- os.path variables -----
2126supports_unicode_filenames = False
2227# aliases (also in os)
@@ -42,21 +47,21 @@ if sys.version_info >= (3, 5):
4247def commonprefix (list : Sequence [AnyStr ]) -> Any : ...
4348
4449def dirname (path : AnyStr ) -> AnyStr : ...
45- def exists (path : _PathType ) -> bool : ...
50+ def exists (path : _FdOrPathType ) -> bool : ...
4651def lexists (path : _PathType ) -> bool : ...
4752def expanduser (path : AnyStr ) -> AnyStr : ...
4853def expandvars (path : AnyStr ) -> AnyStr : ...
4954
5055# These return float if os.stat_float_times() == True,
5156# but int is a subclass of float.
52- def getatime (path : _PathType ) -> float : ...
53- def getmtime (path : _PathType ) -> float : ...
54- def getctime (path : _PathType ) -> float : ...
57+ def getatime (path : _FdOrPathType ) -> float : ...
58+ def getmtime (path : _FdOrPathType ) -> float : ...
59+ def getctime (path : _FdOrPathType ) -> float : ...
5560
56- def getsize (path : _PathType ) -> int : ...
61+ def getsize (path : _FdOrPathType ) -> int : ...
5762def isabs (path : _PathType ) -> bool : ...
58- def isfile (path : _PathType ) -> bool : ...
59- def isdir (path : _PathType ) -> bool : ...
63+ def isfile (path : _FdOrPathType ) -> bool : ...
64+ def isdir (path : _FdOrPathType ) -> bool : ...
6065def islink (path : _PathType ) -> bool : ...
6166def ismount (path : _PathType ) -> bool : ...
6267
8691 def realpath (filename : AnyStr ) -> AnyStr : ...
8792def relpath (path : AnyStr , start : _PathType = ...) -> AnyStr : ...
8893
89- def samefile (path1 : _PathType , path2 : _PathType ) -> bool : ...
94+ def samefile (path1 : _FdOrPathType , path2 : _FdOrPathType ) -> bool : ...
9095def sameopenfile (fp1 : int , fp2 : int ) -> bool : ...
9196# TODO
9297# def samestat(stat1: stat_result,
0 commit comments