mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Add Python 3 ast module; update Python 2.7 ast module; fixup typed_ast (#170)
This commit is contained in:
committed by
Guido van Rossum
parent
8dff6e481e
commit
e8f626536e
@@ -1,516 +1,328 @@
|
||||
from typing import Any
|
||||
from typing import Tuple as TypingTuple
|
||||
import typing
|
||||
from typing import Optional, Union
|
||||
|
||||
__version__ = ... # type: int
|
||||
__version__ = ... # type: str
|
||||
|
||||
PyCF_ONLY_AST = ... # type: int
|
||||
|
||||
class AST(object):
|
||||
_attributes = ... # type: TypingTuple[str]
|
||||
_fields = ... # type: TypingTuple[str]
|
||||
def __init__(self, *args, **kwargs) -> None: pass
|
||||
identifier = str
|
||||
|
||||
class alias(AST):
|
||||
pass
|
||||
|
||||
class arguments(AST):
|
||||
pass
|
||||
|
||||
class boolop(AST):
|
||||
pass
|
||||
|
||||
class cmpop(AST):
|
||||
pass
|
||||
|
||||
class comprehension(AST):
|
||||
pass
|
||||
|
||||
class excepthandler(AST):
|
||||
pass
|
||||
|
||||
class expr(AST):
|
||||
pass
|
||||
|
||||
class expr_context(AST):
|
||||
pass
|
||||
|
||||
class keyword(AST):
|
||||
pass
|
||||
class AST:
|
||||
_attributes = ... # type: typing.Tuple[str, ...]
|
||||
_fields = ... # type: typing.Tuple[str, ...]
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class mod(AST):
|
||||
pass
|
||||
|
||||
class operator(AST):
|
||||
pass
|
||||
|
||||
class slice(AST):
|
||||
pass
|
||||
|
||||
class stmt(AST):
|
||||
pass
|
||||
|
||||
class unaryop(AST):
|
||||
pass
|
||||
|
||||
|
||||
class Add(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class And(boolop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Assert(stmt):
|
||||
test = ... # type: Any
|
||||
msg = ... # type: Any
|
||||
def __init__(self, test = ..., msg = ...) -> None:
|
||||
pass
|
||||
|
||||
class Assign(stmt):
|
||||
targets = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, targets = ..., value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Attribute(expr):
|
||||
value = ... # type: Any
|
||||
attr = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, value = ..., attr = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class AugAssign(stmt):
|
||||
target = ... # type: Any
|
||||
op = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, target = ..., op = ..., value = ...) -> None:
|
||||
pass
|
||||
|
||||
class AugLoad(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class AugStore(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BinOp(expr):
|
||||
left = ... # type: Any
|
||||
op = ... # type: Any
|
||||
right = ... # type: Any
|
||||
def __init__(self, left = ..., op = ..., right = ...) -> None:
|
||||
pass
|
||||
|
||||
class BitAnd(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BitOr(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BitXor(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BoolOp(expr):
|
||||
op = ... # type: Any
|
||||
values = ... # type: Any
|
||||
def __init__(self, op = ..., values = ...) -> None:
|
||||
pass
|
||||
|
||||
class Break(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Call(expr):
|
||||
func = ... # type: Any
|
||||
args = ... # type: Any
|
||||
keywords = ... # type: Any
|
||||
starargs = ... # type: Any
|
||||
kwargs = ... # type: Any
|
||||
def __init__(self, func = ..., args = ..., keywords = ..., starargs = ..., kwargs = ...) -> None:
|
||||
pass
|
||||
|
||||
class ClassDef(stmt):
|
||||
name = ... # type: Any
|
||||
bases = ... # type: Any
|
||||
body = ... # type: Any
|
||||
decorator_list = ... # type: Any
|
||||
def __init__(self, name = ..., bases = ..., body = ..., decorator_list = ...) -> None:
|
||||
pass
|
||||
|
||||
class Compare(expr):
|
||||
left = ... # type: Any
|
||||
ops = ... # type: Any
|
||||
comparators = ... # type: Any
|
||||
def __init__(self, left = ..., ops = ..., comparators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Continue(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Del(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Delete(stmt):
|
||||
targets = ... # type: Any
|
||||
def __init__(self, targets = ...) -> None:
|
||||
pass
|
||||
|
||||
class Dict(expr):
|
||||
keys = ... # type: Any
|
||||
values = ... # type: Any
|
||||
def __init__(self, keys = ..., values = ...) -> None:
|
||||
pass
|
||||
|
||||
class DictComp(expr):
|
||||
key = ... # type: Any
|
||||
value = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, key = ..., value = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Div(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Ellipsis(slice):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Eq(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class ExceptHandler(excepthandler):
|
||||
type = ... # type: Any
|
||||
name = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, type = ..., name = ..., body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Exec(stmt):
|
||||
body = ... # type: Any
|
||||
globals = ... # type: Any
|
||||
locals = ... # type: Any
|
||||
def __init__(self, body = ..., globals = ..., locals = ...) -> None:
|
||||
pass
|
||||
|
||||
class Expr(stmt):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Expression(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class ExtSlice(slice):
|
||||
dims = ... # type: Any
|
||||
def __init__(self, dims = ...) -> None:
|
||||
pass
|
||||
|
||||
class FloorDiv(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class For(stmt):
|
||||
target = ... # type: Any
|
||||
iter = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, target = ..., iter = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class FunctionDef(stmt):
|
||||
name = ... # type: Any
|
||||
args = ... # type: Any
|
||||
body = ... # type: Any
|
||||
decorator_list = ... # type: Any
|
||||
def __init__(self, name = ..., args = ..., body = ..., decorator_list = ...) -> None:
|
||||
pass
|
||||
|
||||
class GeneratorExp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Global(stmt):
|
||||
names = ... # type: Any
|
||||
def __init__(self, names = ...) -> None:
|
||||
pass
|
||||
|
||||
class Gt(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class GtE(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class If(stmt):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class IfExp(expr):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class Import(stmt):
|
||||
names = ... # type: Any
|
||||
def __init__(self, names = ...) -> None:
|
||||
pass
|
||||
|
||||
class ImportFrom(stmt):
|
||||
module = ... # type: Any
|
||||
names = ... # type: Any
|
||||
level = ... # type: Any
|
||||
def __init__(self, module = ..., names = ..., level = ...) -> None:
|
||||
pass
|
||||
|
||||
class In(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Index(slice):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Interactive(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Invert(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Is(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class IsNot(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class LShift(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Lambda(expr):
|
||||
args = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, args = ..., body = ...) -> None:
|
||||
pass
|
||||
|
||||
class List(expr):
|
||||
elts = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, elts = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class ListComp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Load(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Lt(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class LtE(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Mod(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
...
|
||||
|
||||
class Module(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
body = ... # type: typing.List[stmt]
|
||||
|
||||
class Mult(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
class Interactive(mod):
|
||||
body = ... # type: typing.List[stmt]
|
||||
|
||||
class Name(expr):
|
||||
id = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, id = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class Not(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class NotEq(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class NotIn(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Num(expr):
|
||||
n = ... # type: Any
|
||||
def __init__(self, n = ...) -> None:
|
||||
pass
|
||||
|
||||
class Or(boolop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Param(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Pass(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Pow(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Print(stmt):
|
||||
dest = ... # type: Any
|
||||
values = ... # type: Any
|
||||
nl = ... # type: Any
|
||||
def __init__(self, dest = ..., values = ..., nl = ...) -> None:
|
||||
pass
|
||||
|
||||
class RShift(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Raise(stmt):
|
||||
type = ... # type: Any
|
||||
inst = ... # type: Any
|
||||
tback = ... # type: Any
|
||||
def __init__(self, type = ..., inst = ..., tback = ...) -> None:
|
||||
pass
|
||||
|
||||
class Repr(expr):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Return(stmt):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Set(expr):
|
||||
elts = ... # type: Any
|
||||
def __init__(self, elts = ...) -> None:
|
||||
pass
|
||||
|
||||
class SetComp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Slice(slice):
|
||||
lower = ... # type: Any
|
||||
upper = ... # type: Any
|
||||
step = ... # type: Any
|
||||
def __init__(self, lower = ..., upper = ..., step = ...) -> None:
|
||||
pass
|
||||
|
||||
class Store(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Str(expr):
|
||||
s = ... # type: Any
|
||||
def __init__(self, s = ...) -> None:
|
||||
pass
|
||||
|
||||
class Sub(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Subscript(expr):
|
||||
value = ... # type: Any
|
||||
slice = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, value = ..., slice = ..., ctx = ...) -> None:
|
||||
pass
|
||||
class Expression(mod):
|
||||
body = ... # type: expr
|
||||
|
||||
class Suite(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
body = ... # type: typing.List[stmt]
|
||||
|
||||
class TryExcept(stmt):
|
||||
body = ... # type: Any
|
||||
handlers = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, body = ..., handlers = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class TryFinally(stmt):
|
||||
body = ... # type: Any
|
||||
finalbody = ... # type: Any
|
||||
def __init__(self, body = ..., finalbody = ...) -> None:
|
||||
pass
|
||||
class stmt(AST):
|
||||
lineno = ... # type: int
|
||||
col_offset = ... # type: int
|
||||
|
||||
class Tuple(expr):
|
||||
elts = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, elts = ..., ctx = ...) -> None:
|
||||
pass
|
||||
class FunctionDef(stmt):
|
||||
name = ... # type: identifier
|
||||
args = ... # type: arguments
|
||||
body = ... # type: typing.List[stmt]
|
||||
decorator_list = ... # type: typing.List[expr]
|
||||
|
||||
class UAdd(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
class ClassDef(stmt):
|
||||
name = ... # type: identifier
|
||||
bases = ... # type: typing.List[expr]
|
||||
body = ... # type: typing.List[stmt]
|
||||
decorator_list = ... # type: typing.List[expr]
|
||||
|
||||
class USub(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
class Return(stmt):
|
||||
value = ... # type: Optional[expr]
|
||||
|
||||
class UnaryOp(expr):
|
||||
op = ... # type: Any
|
||||
operand = ... # type: Any
|
||||
def __init__(self, op = ..., operand = ...) -> None:
|
||||
pass
|
||||
class Delete(stmt):
|
||||
targets = ... # type: typing.List[expr]
|
||||
|
||||
class Assign(stmt):
|
||||
targets = ... # type: typing.List[expr]
|
||||
value = ... # type: expr
|
||||
|
||||
class AugAssign(stmt):
|
||||
target = ... # type: expr
|
||||
op = ... # type: operator
|
||||
value = ... # type: expr
|
||||
|
||||
class Print(stmt):
|
||||
dest = ... # type: Optional[expr]
|
||||
values = ... # type: typing.List[expr]
|
||||
nl = ... # type: bool
|
||||
|
||||
class For(stmt):
|
||||
target = ... # type: expr
|
||||
iter = ... # type: expr
|
||||
body = ... # type: typing.List[stmt]
|
||||
orelse = ... # type: typing.List[stmt]
|
||||
|
||||
class While(stmt):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
test = ... # type: expr
|
||||
body = ... # type: typing.List[stmt]
|
||||
orelse = ... # type: typing.List[stmt]
|
||||
|
||||
class If(stmt):
|
||||
test = ... # type: expr
|
||||
body = ... # type: typing.List[stmt]
|
||||
orelse = ... # type: typing.List[stmt]
|
||||
|
||||
class With(stmt):
|
||||
context_expr = ... # type: Any
|
||||
optional_vars = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, context_expr = ..., optional_vars = ..., body = ...) -> None:
|
||||
pass
|
||||
context_expr = ... # type: expr
|
||||
optional_vars = ... # type: Optional[expr]
|
||||
body = ... # type: typing.List[stmt]
|
||||
|
||||
class Raise(stmt):
|
||||
type = ... # type: Optional[expr]
|
||||
inst = ... # type: Optional[expr]
|
||||
tback = ... # type: Optional[expr]
|
||||
|
||||
class TryExcept(stmt):
|
||||
body = ... # type: typing.List[stmt]
|
||||
handlers = ... # type: typing.List[ExceptHandler]
|
||||
orelse = ... # type: typing.List[stmt]
|
||||
|
||||
class TryFinally(stmt):
|
||||
body = ... # type: typing.List[stmt]
|
||||
finalbody = ... # type: typing.List[stmt]
|
||||
|
||||
class Assert(stmt):
|
||||
test = ... # type: expr
|
||||
msg = ... # type: Optional[expr]
|
||||
|
||||
class Import(stmt):
|
||||
names = ... # type: typing.List[alias]
|
||||
|
||||
class ImportFrom(stmt):
|
||||
module = ... # type: Optional[identifier]
|
||||
names = ... # type: typing.List[alias]
|
||||
level = ... # type: Optional[int]
|
||||
|
||||
class Exec(stmt):
|
||||
body = ... # type: expr
|
||||
globals = ... # type: Optional[expr]
|
||||
locals = ... # type: Optional[expr]
|
||||
|
||||
class Global(stmt):
|
||||
names = ... # type: typing.List[identifier]
|
||||
|
||||
class Expr(stmt):
|
||||
value = ... # type: expr
|
||||
|
||||
class Pass(stmt): ...
|
||||
class Break(stmt): ...
|
||||
class Continue(stmt): ...
|
||||
|
||||
|
||||
class slice(AST):
|
||||
...
|
||||
|
||||
_slice = slice # this lets us type the variable named 'slice' below
|
||||
|
||||
class Slice(slice):
|
||||
lower = ... # type: Optional[expr]
|
||||
upper = ... # type: Optional[expr]
|
||||
step = ... # type: Optional[expr]
|
||||
|
||||
class ExtSlice(slice):
|
||||
dims = ... # type: typing.List[slice]
|
||||
|
||||
class Index(slice):
|
||||
value = ... # type: expr
|
||||
|
||||
class Ellipsis(slice): ...
|
||||
|
||||
|
||||
class expr(AST):
|
||||
lineno = ... # type: int
|
||||
col_offset = ... # type: int
|
||||
|
||||
class BoolOp(expr):
|
||||
op = ... # type: boolop
|
||||
values = ... # type: typing.List[expr]
|
||||
|
||||
class BinOp(expr):
|
||||
left = ... # type: expr
|
||||
op = ... # type: operator
|
||||
right = ... # type: expr
|
||||
|
||||
class UnaryOp(expr):
|
||||
op = ... # type: unaryop
|
||||
operand = ... # type: expr
|
||||
|
||||
class Lambda(expr):
|
||||
args = ... # type: arguments
|
||||
body = ... # type: expr
|
||||
|
||||
class IfExp(expr):
|
||||
test = ... # type: expr
|
||||
body = ... # type: expr
|
||||
orelse = ... # type: expr
|
||||
|
||||
class Dict(expr):
|
||||
keys = ... # type: typing.List[expr]
|
||||
values = ... # type: typing.List[expr]
|
||||
|
||||
class Set(expr):
|
||||
elts = ... # type: typing.List[expr]
|
||||
|
||||
class ListComp(expr):
|
||||
elt = ... # type: expr
|
||||
generators = ... # type: typing.List[comprehension]
|
||||
|
||||
class SetComp(expr):
|
||||
elt = ... # type: expr
|
||||
generators = ... # type: typing.List[comprehension]
|
||||
|
||||
class DictComp(expr):
|
||||
key = ... # type: expr
|
||||
value = ... # type: expr
|
||||
generators = ... # type: typing.List[comprehension]
|
||||
|
||||
class GeneratorExp(expr):
|
||||
elt = ... # type: expr
|
||||
generators = ... # type: typing.List[comprehension]
|
||||
|
||||
class Yield(expr):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
value = ... # type: Optional[expr]
|
||||
|
||||
class Compare(expr):
|
||||
left = ... # type: expr
|
||||
ops = ... # type: typing.List[cmpop]
|
||||
comparators = ... # type: typing.List[expr]
|
||||
|
||||
class Call(expr):
|
||||
func = ... # type: expr
|
||||
args = ... # type: typing.List[expr]
|
||||
keywords = ... # type: typing.List[keyword]
|
||||
starargs = ... # type: Optional[expr]
|
||||
kwargs = ... # type: Optional[expr]
|
||||
|
||||
class Repr(expr):
|
||||
value = ... # type: expr
|
||||
|
||||
class Num(expr):
|
||||
n = ... # type: Union[int, float]
|
||||
|
||||
class Str(expr):
|
||||
s = ... # type: str
|
||||
|
||||
class Attribute(expr):
|
||||
value = ... # type: expr
|
||||
attr = ... # type: identifier
|
||||
ctx = ... # type: expr_context
|
||||
|
||||
class Subscript(expr):
|
||||
value = ... # type: expr
|
||||
slice = ... # type: _slice
|
||||
ctx = ... # type: expr_context
|
||||
|
||||
class Name(expr):
|
||||
id = ... # type: identifier
|
||||
ctx = ... # type: expr_context
|
||||
|
||||
class List(expr):
|
||||
elts = ... # type: typing.List[expr]
|
||||
ctx = ... # type: expr_context
|
||||
|
||||
class Tuple(expr):
|
||||
elts = ... # type: typing.List[expr]
|
||||
ctx = ... # type: expr_context
|
||||
|
||||
|
||||
class expr_context(AST):
|
||||
...
|
||||
|
||||
class AugLoad(expr_context): ...
|
||||
class AugStore(expr_context): ...
|
||||
class Del(expr_context): ...
|
||||
class Load(expr_context): ...
|
||||
class Param(expr_context): ...
|
||||
class Store(expr_context): ...
|
||||
|
||||
|
||||
class boolop(AST):
|
||||
...
|
||||
|
||||
class And(boolop): ...
|
||||
class Or(boolop): ...
|
||||
|
||||
class operator(AST):
|
||||
...
|
||||
|
||||
class Add(operator): ...
|
||||
class BitAnd(operator): ...
|
||||
class BitOr(operator): ...
|
||||
class BitXor(operator): ...
|
||||
class Div(operator): ...
|
||||
class FloorDiv(operator): ...
|
||||
class LShift(operator): ...
|
||||
class Mod(operator): ...
|
||||
class Mult(operator): ...
|
||||
class Pow(operator): ...
|
||||
class RShift(operator): ...
|
||||
class Sub(operator): ...
|
||||
|
||||
class unaryop(AST):
|
||||
...
|
||||
|
||||
class Invert(unaryop): ...
|
||||
class Not(unaryop): ...
|
||||
class UAdd(unaryop): ...
|
||||
class USub(unaryop): ...
|
||||
|
||||
class cmpop(AST):
|
||||
...
|
||||
|
||||
class Eq(cmpop): ...
|
||||
class Gt(cmpop): ...
|
||||
class GtE(cmpop): ...
|
||||
class In(cmpop): ...
|
||||
class Is(cmpop): ...
|
||||
class IsNot(cmpop): ...
|
||||
class Lt(cmpop): ...
|
||||
class LtE(cmpop): ...
|
||||
class NotEq(cmpop): ...
|
||||
class NotIn(cmpop): ...
|
||||
|
||||
|
||||
class comprehension(AST):
|
||||
target = ... # type: expr
|
||||
iter = ... # type: expr
|
||||
ifs = ... # type: typing.List[expr]
|
||||
|
||||
|
||||
class ExceptHandler(AST):
|
||||
type = ... # type: Optional[expr]
|
||||
name = ... # type: Optional[expr]
|
||||
body = ... # type: typing.List[stmt]
|
||||
lineno = ... # type: int
|
||||
col_offset = ... # type: int
|
||||
|
||||
|
||||
class arguments(AST):
|
||||
args = ... # type: typing.List[expr]
|
||||
vararg = ... # type: Optional[identifier]
|
||||
kwarg = ... # type: Optional[identifier]
|
||||
defaults = ... # type: typing.List[expr]
|
||||
|
||||
class keyword(AST):
|
||||
arg = ... # type: identifier
|
||||
value = ... # type: expr
|
||||
|
||||
class alias(AST):
|
||||
name = ... # type: identifier
|
||||
asname = ... # type: Optional[identifier]
|
||||
|
||||
@@ -1,40 +1,45 @@
|
||||
# Automatically generated by pytype. May contain errors.
|
||||
# Python 2.7 ast
|
||||
|
||||
from typing import Any, Tuple, Generator
|
||||
import typing
|
||||
from typing import Any, Tuple, Iterator, Union
|
||||
|
||||
from _ast import (
|
||||
AST, alias, arguments, boolop, cmpop, comprehension, excepthandler,
|
||||
expr, expr_context, keyword, mod, operator, slice, stmt, unaryop, Add,
|
||||
And, Assert, Assign, Attribute, AugAssign, AugLoad, AugStore, BinOp,
|
||||
BitAnd, BitOr, BitXor, BoolOp, Break, Call, ClassDef, Compare, Continue,
|
||||
Del, Delete, Dict, DictComp, Div, Ellipsis, Eq, ExceptHandler, Exec,
|
||||
Expr, Expression, ExtSlice, FloorDiv, For, FunctionDef, GeneratorExp,
|
||||
Global, Gt, GtE, If, IfExp, Import, ImportFrom, In, Index, Interactive,
|
||||
Invert, Is, IsNot, LShift, Lambda, List, ListComp, Load, Lt, LtE, Mod,
|
||||
Module, Mult, Name, Not, NotEq, NotIn, Num, Or, Param, Pass, Pow, Print,
|
||||
RShift, Raise, Repr, Return, Set, SetComp, Slice, Store, Str, Sub,
|
||||
Subscript, Suite, TryExcept, TryFinally, Tuple, UAdd, USub, UnaryOp,
|
||||
While, With, Yield)
|
||||
Add, alias, And, arguments, Assert, Assign, AST, Attribute, AugAssign,
|
||||
AugLoad, AugStore, BinOp, BitAnd, BitOr, BitXor, BoolOp, boolop, Break,
|
||||
Call, ClassDef, cmpop, Compare, comprehension, Continue, Del, Delete, Dict,
|
||||
DictComp, Div, Ellipsis, Eq, ExceptHandler, Exec, Expr, expr, Expression,
|
||||
expr_context, ExtSlice, FloorDiv, For, FunctionDef, GeneratorExp, Global,
|
||||
Gt, GtE, If, IfExp, Import, ImportFrom, In, Index, Interactive, Invert, Is,
|
||||
IsNot, keyword, Lambda, List, ListComp, Load, LShift, Lt, LtE, Mod, mod,
|
||||
Module, Mult, Name, Not, NotEq, NotIn, Num, operator, Or, Param, Pass, Pow,
|
||||
Print, Raise, Repr, Return, RShift, Set, SetComp, Slice, slice, stmt,
|
||||
Store, Str, Sub, Subscript, Suite, TryExcept, TryFinally, Tuple, UAdd,
|
||||
UnaryOp, unaryop, USub, While, With, Yield
|
||||
)
|
||||
|
||||
__version__ = ... # type: int
|
||||
__version__ = ... # type: str
|
||||
PyCF_ONLY_AST = ... # type: int
|
||||
|
||||
def copy_location(new_node, old_node) -> Any: ...
|
||||
def dump(node, *args, **kwargs) -> str: ...
|
||||
def fix_missing_locations(node) -> Any: ...
|
||||
def get_docstring(node, *args, **kwargs) -> Any: ...
|
||||
def increment_lineno(node, *args, **kwargs) -> Any: ...
|
||||
def iter_child_nodes(node) -> Generator[Any, Any, Any]: ...
|
||||
def iter_fields(node) -> Any: ... # TODO: Generator[Tuple[Any, ...]]: ...
|
||||
def literal_eval(node_or_string) -> Any: ...
|
||||
def parse(source, filename = ..., mode = ..., *args, **kwargs) -> AST: ...
|
||||
def walk(node) -> Any: ... # TODO: Generator[Any]: ...
|
||||
|
||||
class NodeVisitor(object):
|
||||
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
|
||||
def copy_location(new_node: AST, old_node: AST) -> AST: ...
|
||||
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
|
||||
def fix_missing_locations(node: AST) -> AST: ...
|
||||
def get_docstring(node: AST, clean: bool = ...) -> str: ...
|
||||
def increment_lineno(node: AST, n: int = ...) -> AST: ...
|
||||
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
|
||||
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
|
||||
def literal_eval(node_or_string: Union[str, AST]) -> Any: ...
|
||||
def walk(node: AST) -> Iterator[AST]: ...
|
||||
|
||||
class NodeVisitor():
|
||||
__doc__ = ... # type: str
|
||||
def generic_visit(self, node) -> None: ...
|
||||
def visit(self, node) -> Any: ...
|
||||
def visit(self, node: AST) -> Any: ...
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
class NodeTransformer(NodeVisitor):
|
||||
__doc__ = ... # type: str
|
||||
def generic_visit(self, node) -> Any: ...
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user