mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
@@ -1207,13 +1207,27 @@ if sys.version_info < (3,):
|
||||
_N1 = TypeVar("_N1", bool, int, float, complex)
|
||||
def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
# This class is to be exported as PathLike from os,
|
||||
# but we define it here as _PathLike to avoid import cycle issues.
|
||||
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
|
||||
_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True)
|
||||
class _PathLike(Protocol[_AnyStr_co]):
|
||||
def __fspath__(self) -> _AnyStr_co: ...
|
||||
# This class is to be exported as PathLike from os,
|
||||
# but we define it here as _PathLike to avoid import cycle issues.
|
||||
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
|
||||
_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True)
|
||||
|
||||
class _PathLike(Protocol[_AnyStr_co]):
|
||||
def __fspath__(self) -> _AnyStr_co: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def compile(
|
||||
source: Union[str, bytes, mod, AST],
|
||||
filename: Union[str, bytes, _PathLike[Any]],
|
||||
mode: str,
|
||||
flags: int = ...,
|
||||
dont_inherit: int = ...,
|
||||
optimize: int = ...,
|
||||
*,
|
||||
_feature_version: int = ...,
|
||||
) -> Any: ...
|
||||
|
||||
elif sys.version_info >= (3, 6):
|
||||
def compile(
|
||||
source: Union[str, bytes, mod, AST],
|
||||
filename: Union[str, bytes, _PathLike[Any]],
|
||||
@@ -1624,9 +1638,9 @@ if sys.version_info < (3,):
|
||||
def reload(__module: Any) -> Any: ...
|
||||
|
||||
@overload
|
||||
def reversed(__object: Sequence[_T]) -> Iterator[_T]: ...
|
||||
def reversed(__sequence: Sequence[_T]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def reversed(__object: Reversible[_T]) -> Iterator[_T]: ...
|
||||
def reversed(__sequence: Reversible[_T]) -> Iterator[_T]: ...
|
||||
def repr(__obj: object) -> str: ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
|
||||
Reference in New Issue
Block a user