mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
PathLike cleanup (#5242)
Copy builtins._PathLike to os.PathLike Use os.PathLike exclusively outside of builtins
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import AnyStr, Sequence, Text, Union
|
||||
from _typeshed import AnyPath
|
||||
from typing import AnyStr, Sequence, Text
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
def commonprefix(m: Sequence[str]) -> str: ...
|
||||
@@ -7,13 +8,7 @@ if sys.version_info >= (3, 0):
|
||||
else:
|
||||
def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike
|
||||
def exists(path: Union[AnyStr, _PathLike[AnyStr]]) -> bool: ...
|
||||
|
||||
else:
|
||||
def exists(path: Text) -> bool: ...
|
||||
|
||||
def exists(path: AnyPath) -> bool: ...
|
||||
def isfile(path: Text) -> bool: ...
|
||||
def isdir(s: Text) -> bool: ...
|
||||
def getsize(filename: Text) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user