use _typeshed's Path aliases (#4214)

This commit is contained in:
Jelle Zijlstra
2020-06-10 20:57:09 -07:00
committed by GitHub
parent 86f03f2d7b
commit 43e93f803f
42 changed files with 483 additions and 757 deletions

View File

@@ -1,13 +1,6 @@
from typing import Any, List, Sequence, Text, Tuple, Union
from typing import Any, List, Sequence, Text, Tuple
from types import CodeType
import sys
if sys.version_info >= (3, 6):
from builtins import _PathLike
_Path = Union[str, bytes, _PathLike]
else:
_Path = Union[str, bytes]
from _typeshed import AnyPath
def expr(source: Text) -> STType: ...
def suite(source: Text) -> STType: ...
@@ -15,14 +8,14 @@ def sequence2st(sequence: Sequence[Any]) -> STType: ...
def tuple2st(sequence: Sequence[Any]) -> STType: ...
def st2list(st: STType, line_info: bool = ..., col_info: bool = ...) -> List[Any]: ...
def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> Tuple[Any]: ...
def compilest(st: STType, filename: _Path = ...) -> CodeType: ...
def compilest(st: STType, filename: AnyPath = ...) -> CodeType: ...
def isexpr(st: STType) -> bool: ...
def issuite(st: STType) -> bool: ...
class ParserError(Exception): ...
class STType:
def compile(self, filename: _Path = ...) -> CodeType: ...
def compile(self, filename: AnyPath = ...) -> CodeType: ...
def isexpr(self) -> bool: ...
def issuite(self) -> bool: ...
def tolist(self, line_info: bool = ..., col_info: bool = ...) -> List[Any]: ...