Add PathLike to genericpath.exists and re-export (#3897)

Closes#3492
This commit is contained in:
Debjyoti Biswas
2020-04-02 13:21:59 +05:30
committed by GitHub
parent cb87bd1f53
commit f4a646d43c
6 changed files with 11 additions and 23 deletions

View File

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