Module opshin.typed_ast
Expand source code
from .type_impls import *
class TypedAST(AST):
typ: Type
class typedexpr(TypedAST, expr):
def typechecks(self) -> typing.Dict[str, Type]:
"""Successful typechecks if this expression evaluates to True"""
return {}
class typedstmt(TypedAST, stmt):
# Statements always have type None
typ = NoneInstanceType
class typedarg(TypedAST, arg):
pass
class typedarguments(TypedAST, arguments):
args: typing.List[typedarg]
vararg: typing.Union[typedarg, None]
kwonlyargs: typing.List[typedarg]
kw_defaults: typing.List[typing.Union[typedexpr, None]]
kwarg: typing.Union[typedarg, None]
defaults: typing.List[typedexpr]
class TypedModule(typedstmt, Module):
body: typing.List[typedstmt]
class TypedFunctionDef(typedstmt, FunctionDef):
body: typing.List[typedstmt]
args: typedarguments
class TypedIf(typedstmt, If):
test: typedexpr
body: typing.List[typedstmt]
orelse: typing.List[typedstmt]
class TypedReturn(typedstmt, Return):
value: typedexpr
class TypedExpression(typedstmt, Expression):
body: typedexpr
class TypedCall(typedexpr, Call):
func: typedexpr
args: typing.List[typedexpr]
class TypedExpr(typedstmt, Expr):
value: typedexpr
class TypedAssign(typedstmt, Assign):
targets: typing.List[typedexpr]
value: typedexpr
class TypedClassDef(typedstmt, ClassDef):
class_typ: Type
class TypedAnnAssign(typedstmt, AnnAssign):
target: typedexpr
annotation: Type
value: typedexpr
class TypedWhile(typedstmt, While):
test: typedexpr
body: typing.List[typedstmt]
orelse: typing.List[typedstmt]
class TypedFor(typedstmt, For):
target: typedexpr
iter: typedexpr
body: typing.List[typedstmt]
orelse: typing.List[typedstmt]
class TypedPass(typedstmt, Pass):
pass
class TypedName(typedexpr, Name):
pass
class Typedkeyword(TypedAST, keyword):
arg: typedexpr
value: typedexpr
class TypedConstant(TypedAST, Constant):
pass
class TypedTuple(typedexpr, Tuple):
pass
class TypedList(typedexpr, List):
pass
class typedcomprehension(typedexpr, comprehension):
target: typedexpr
iter: typedexpr
ifs: typing.List[typedexpr]
class TypedListComp(typedexpr, ListComp):
elt: typedexpr
generators: typing.List[typedcomprehension]
class TypedDictComp(typedexpr, DictComp):
key: typedexpr
value: typedexpr
generators: typing.List[typedcomprehension]
class TypedFormattedValue(typedexpr, FormattedValue):
value: typedexpr
conversion: int
format_spec: typing.Optional[JoinedStr]
class TypedJoinedStr(typedexpr, JoinedStr):
values: typing.List[typedexpr]
class TypedDict(typedexpr, Dict):
pass
class TypedIfExp(typedstmt, IfExp):
test: typedexpr
body: typedexpr
orelse: typedexpr
class TypedCompare(typedexpr, Compare):
left: typedexpr
ops: typing.List[cmpop]
comparators: typing.List[typedexpr]
class TypedBinOp(typedexpr, BinOp):
left: typedexpr
right: typedexpr
class TypedBoolOp(typedexpr, BoolOp):
values: typing.List[typedexpr]
class TypedUnaryOp(typedexpr, UnaryOp):
operand: typedexpr
class TypedSubscript(typedexpr, Subscript):
value: typedexpr
class TypedAttribute(typedexpr, Attribute):
value: typedexpr
pos: int
class TypedAssert(typedstmt, Assert):
test: typedexpr
msg: typedexpr
class RawPlutoExpr(typedexpr):
typ: Type
expr: plt.AST
_attributes = ["lineno", "col_offset", "end_lineno", "end_col_offset"]
_fields = []
Classes
class RawPlutoExpr (*args, **kwargs)
-
expr = BoolOp(boolop op, expr values) | NamedExpr(expr target, expr value) | BinOp(expr left, operator op, expr right) | UnaryOp(unaryop op, expr operand) | Lambda(arguments args, expr body) | IfExp(expr test, expr body, expr orelse) | Dict(expr keys, expr values) | Set(expr elts) | ListComp(expr elt, comprehension generators) | SetComp(expr elt, comprehension generators) | DictComp(expr key, expr value, comprehension generators) | GeneratorExp(expr elt, comprehension generators) | Await(expr value) | Yield(expr? value) | YieldFrom(expr value) | Compare(expr left, cmpop ops, expr comparators) | Call(expr func, expr args, keyword keywords) | FormattedValue(expr value, int conversion, expr? format_spec) | JoinedStr(expr values) | Constant(constant value, string? kind) | Attribute(expr value, identifier attr, expr_context ctx) | Subscript(expr value, expr slice, expr_context ctx) | Starred(expr value, expr_context ctx) | Name(identifier id, expr_context ctx) | List(expr elts, expr_context ctx) | Tuple(expr* elts, expr_context ctx) | Slice(expr? lower, expr? upper, expr? step)
Expand source code
class RawPlutoExpr(typedexpr): typ: Type expr: plt.AST _attributes = ["lineno", "col_offset", "end_lineno", "end_col_offset"] _fields = []
Ancestors
Class variables
var expr : pluthon.pluthon_ast.AST
var typ : Type
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedAST (*args, **kwargs)
-
Expand source code
class TypedAST(AST): typ: Type
Ancestors
- ast.AST
Subclasses
Class variables
var typ : Type
class TypedAnnAssign (*args, **kwargs)
-
AnnAssign(expr target, expr annotation, expr? value, int simple)
Expand source code
class TypedAnnAssign(typedstmt, AnnAssign): target: typedexpr annotation: Type value: typedexpr
Ancestors
Class variables
var annotation : Type
var target : typedexpr
var value : typedexpr
class TypedAssert (*args, **kwargs)
-
Assert(expr test, expr? msg)
Expand source code
class TypedAssert(typedstmt, Assert): test: typedexpr msg: typedexpr
Ancestors
Class variables
var msg : typedexpr
var test : typedexpr
class TypedAssign (*args, **kwargs)
-
Assign(expr* targets, expr value, string? type_comment)
Expand source code
class TypedAssign(typedstmt, Assign): targets: typing.List[typedexpr] value: typedexpr
Ancestors
Class variables
var targets : List[typedexpr]
var value : typedexpr
class TypedAttribute (*args, **kwargs)
-
Attribute(expr value, identifier attr, expr_context ctx)
Expand source code
class TypedAttribute(typedexpr, Attribute): value: typedexpr pos: int
Ancestors
Class variables
var pos : int
var value : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedBinOp (*args, **kwargs)
-
BinOp(expr left, operator op, expr right)
Expand source code
class TypedBinOp(typedexpr, BinOp): left: typedexpr right: typedexpr
Ancestors
Class variables
var left : typedexpr
var right : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedBoolOp (*args, **kwargs)
-
BoolOp(boolop op, expr* values)
Expand source code
class TypedBoolOp(typedexpr, BoolOp): values: typing.List[typedexpr]
Ancestors
Class variables
var values : List[typedexpr]
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedCall (*args, **kwargs)
-
Call(expr func, expr args, keyword keywords)
Expand source code
class TypedCall(typedexpr, Call): func: typedexpr args: typing.List[typedexpr]
Ancestors
Class variables
var args : List[typedexpr]
var func : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedClassDef (*args, **kwargs)
-
ClassDef(identifier name, expr bases, keyword keywords, stmt body, expr decorator_list)
Expand source code
class TypedClassDef(typedstmt, ClassDef): class_typ: Type
Ancestors
Class variables
var class_typ : Type
class TypedCompare (*args, **kwargs)
-
Compare(expr left, cmpop ops, expr comparators)
Expand source code
class TypedCompare(typedexpr, Compare): left: typedexpr ops: typing.List[cmpop] comparators: typing.List[typedexpr]
Ancestors
Class variables
var comparators : List[typedexpr]
var left : typedexpr
var ops : List[ast.cmpop]
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedConstant (*args, **kwargs)
-
Constant(constant value, string? kind)
Expand source code
class TypedConstant(TypedAST, Constant): pass
Ancestors
- TypedAST
- ast.Constant
- ast.expr
- ast.AST
class TypedDict (*args, **kwargs)
-
Dict(expr keys, expr values)
Expand source code
class TypedDict(typedexpr, Dict): pass
Ancestors
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedDictComp (*args, **kwargs)
-
DictComp(expr key, expr value, comprehension* generators)
Expand source code
class TypedDictComp(typedexpr, DictComp): key: typedexpr value: typedexpr generators: typing.List[typedcomprehension]
Ancestors
Class variables
var generators : List[typedcomprehension]
var key : typedexpr
var value : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedExpr (*args, **kwargs)
-
Expr(expr value)
Expand source code
class TypedExpr(typedstmt, Expr): value: typedexpr
Ancestors
Class variables
var value : typedexpr
class TypedExpression (*args, **kwargs)
-
stmt = FunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | AsyncFunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | ClassDef(identifier name, expr bases, keyword keywords, stmt body, expr decorator_list) | Return(expr? value) | Delete(expr targets) | Assign(expr targets, expr value, string? type_comment) | AugAssign(expr target, operator op, expr value) | AnnAssign(expr target, expr annotation, expr? value, int simple) | For(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | AsyncFor(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | While(expr test, stmt body, stmt orelse) | If(expr test, stmt body, stmt orelse) | With(withitem items, stmt body, string? type_comment) | AsyncWith(withitem items, stmt body, string? type_comment) | Match(expr subject, match_case cases) | Raise(expr? exc, expr? cause) | Try(stmt body, excepthandler handlers, stmt orelse, stmt finalbody) | Assert(expr test, expr? msg) | Import(alias names) | ImportFrom(identifier? module, alias names, int? level) | Global(identifier names) | Nonlocal(identifier* names) | Expr(expr value) | Pass | Break | Continue
Expand source code
class TypedExpression(typedstmt, Expression): body: typedexpr
Ancestors
Class variables
var body : typedexpr
class TypedFor (*args, **kwargs)
-
For(expr target, expr iter, stmt body, stmt orelse, string? type_comment)
Expand source code
class TypedFor(typedstmt, For): target: typedexpr iter: typedexpr body: typing.List[typedstmt] orelse: typing.List[typedstmt]
Ancestors
Class variables
var body : List[typedstmt]
var iter : typedexpr
var orelse : List[typedstmt]
var target : typedexpr
class TypedFormattedValue (*args, **kwargs)
-
FormattedValue(expr value, int conversion, expr? format_spec)
Expand source code
class TypedFormattedValue(typedexpr, FormattedValue): value: typedexpr conversion: int format_spec: typing.Optional[JoinedStr]
Ancestors
Class variables
var conversion : int
var format_spec : Optional[ast.JoinedStr]
var value : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedFunctionDef (*args, **kwargs)
-
FunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment)
Expand source code
class TypedFunctionDef(typedstmt, FunctionDef): body: typing.List[typedstmt] args: typedarguments
Ancestors
Class variables
var args : typedarguments
var body : List[typedstmt]
class TypedIf (*args, **kwargs)
-
If(expr test, stmt body, stmt orelse)
Expand source code
class TypedIf(typedstmt, If): test: typedexpr body: typing.List[typedstmt] orelse: typing.List[typedstmt]
Ancestors
Class variables
var body : List[typedstmt]
var orelse : List[typedstmt]
var test : typedexpr
class TypedIfExp (*args, **kwargs)
-
stmt = FunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | AsyncFunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | ClassDef(identifier name, expr bases, keyword keywords, stmt body, expr decorator_list) | Return(expr? value) | Delete(expr targets) | Assign(expr targets, expr value, string? type_comment) | AugAssign(expr target, operator op, expr value) | AnnAssign(expr target, expr annotation, expr? value, int simple) | For(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | AsyncFor(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | While(expr test, stmt body, stmt orelse) | If(expr test, stmt body, stmt orelse) | With(withitem items, stmt body, string? type_comment) | AsyncWith(withitem items, stmt body, string? type_comment) | Match(expr subject, match_case cases) | Raise(expr? exc, expr? cause) | Try(stmt body, excepthandler handlers, stmt orelse, stmt finalbody) | Assert(expr test, expr? msg) | Import(alias names) | ImportFrom(identifier? module, alias names, int? level) | Global(identifier names) | Nonlocal(identifier* names) | Expr(expr value) | Pass | Break | Continue
Expand source code
class TypedIfExp(typedstmt, IfExp): test: typedexpr body: typedexpr orelse: typedexpr
Ancestors
Class variables
var body : typedexpr
var orelse : typedexpr
var test : typedexpr
class TypedJoinedStr (*args, **kwargs)
-
JoinedStr(expr* values)
Expand source code
class TypedJoinedStr(typedexpr, JoinedStr): values: typing.List[typedexpr]
Ancestors
Class variables
var values : List[typedexpr]
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedList (*args, **kwargs)
-
List(expr* elts, expr_context ctx)
Expand source code
class TypedList(typedexpr, List): pass
Ancestors
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedListComp (*args, **kwargs)
-
ListComp(expr elt, comprehension* generators)
Expand source code
class TypedListComp(typedexpr, ListComp): elt: typedexpr generators: typing.List[typedcomprehension]
Ancestors
Class variables
var elt : typedexpr
var generators : List[typedcomprehension]
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedModule (*args, **kwargs)
-
stmt = FunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | AsyncFunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | ClassDef(identifier name, expr bases, keyword keywords, stmt body, expr decorator_list) | Return(expr? value) | Delete(expr targets) | Assign(expr targets, expr value, string? type_comment) | AugAssign(expr target, operator op, expr value) | AnnAssign(expr target, expr annotation, expr? value, int simple) | For(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | AsyncFor(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | While(expr test, stmt body, stmt orelse) | If(expr test, stmt body, stmt orelse) | With(withitem items, stmt body, string? type_comment) | AsyncWith(withitem items, stmt body, string? type_comment) | Match(expr subject, match_case cases) | Raise(expr? exc, expr? cause) | Try(stmt body, excepthandler handlers, stmt orelse, stmt finalbody) | Assert(expr test, expr? msg) | Import(alias names) | ImportFrom(identifier? module, alias names, int? level) | Global(identifier names) | Nonlocal(identifier* names) | Expr(expr value) | Pass | Break | Continue
Expand source code
class TypedModule(typedstmt, Module): body: typing.List[typedstmt]
Ancestors
Class variables
var body : List[typedstmt]
class TypedName (*args, **kwargs)
-
Name(identifier id, expr_context ctx)
Expand source code
class TypedName(typedexpr, Name): pass
Ancestors
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedPass (*args, **kwargs)
-
Pass
Expand source code
class TypedPass(typedstmt, Pass): pass
Ancestors
class TypedReturn (*args, **kwargs)
-
Return(expr? value)
Expand source code
class TypedReturn(typedstmt, Return): value: typedexpr
Ancestors
Class variables
var value : typedexpr
class TypedSubscript (*args, **kwargs)
-
Subscript(expr value, expr slice, expr_context ctx)
Expand source code
class TypedSubscript(typedexpr, Subscript): value: typedexpr
Ancestors
Class variables
var value : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedTuple (*args, **kwargs)
-
Tuple(expr* elts, expr_context ctx)
Expand source code
class TypedTuple(typedexpr, Tuple): pass
Ancestors
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedUnaryOp (*args, **kwargs)
-
UnaryOp(unaryop op, expr operand)
Expand source code
class TypedUnaryOp(typedexpr, UnaryOp): operand: typedexpr
Ancestors
Class variables
var operand : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class TypedWhile (*args, **kwargs)
-
While(expr test, stmt body, stmt orelse)
Expand source code
class TypedWhile(typedstmt, While): test: typedexpr body: typing.List[typedstmt] orelse: typing.List[typedstmt]
Ancestors
Class variables
var body : List[typedstmt]
var orelse : List[typedstmt]
var test : typedexpr
class Typedkeyword (*args, **kwargs)
-
keyword(identifier? arg, expr value)
Expand source code
class Typedkeyword(TypedAST, keyword): arg: typedexpr value: typedexpr
Ancestors
- TypedAST
- ast.keyword
- ast.AST
Class variables
var arg : typedexpr
var value : typedexpr
class typedarg (*args, **kwargs)
-
arg(identifier arg, expr? annotation, string? type_comment)
Expand source code
class typedarg(TypedAST, arg): pass
Ancestors
- TypedAST
- ast.arg
- ast.AST
class typedarguments (*args, **kwargs)
-
arguments(arg posonlyargs, arg args, arg? vararg, arg kwonlyargs, expr kw_defaults, arg? kwarg, expr* defaults)
Expand source code
class typedarguments(TypedAST, arguments): args: typing.List[typedarg] vararg: typing.Union[typedarg, None] kwonlyargs: typing.List[typedarg] kw_defaults: typing.List[typing.Union[typedexpr, None]] kwarg: typing.Union[typedarg, None] defaults: typing.List[typedexpr]
Ancestors
- TypedAST
- ast.arguments
- ast.AST
Class variables
var args : List[typedarg]
var defaults : List[typedexpr]
var kw_defaults : List[Optional[typedexpr]]
var kwarg : Optional[typedarg]
var kwonlyargs : List[typedarg]
var vararg : Optional[typedarg]
class typedcomprehension (*args, **kwargs)
-
expr = BoolOp(boolop op, expr values) | NamedExpr(expr target, expr value) | BinOp(expr left, operator op, expr right) | UnaryOp(unaryop op, expr operand) | Lambda(arguments args, expr body) | IfExp(expr test, expr body, expr orelse) | Dict(expr keys, expr values) | Set(expr elts) | ListComp(expr elt, comprehension generators) | SetComp(expr elt, comprehension generators) | DictComp(expr key, expr value, comprehension generators) | GeneratorExp(expr elt, comprehension generators) | Await(expr value) | Yield(expr? value) | YieldFrom(expr value) | Compare(expr left, cmpop ops, expr comparators) | Call(expr func, expr args, keyword keywords) | FormattedValue(expr value, int conversion, expr? format_spec) | JoinedStr(expr values) | Constant(constant value, string? kind) | Attribute(expr value, identifier attr, expr_context ctx) | Subscript(expr value, expr slice, expr_context ctx) | Starred(expr value, expr_context ctx) | Name(identifier id, expr_context ctx) | List(expr elts, expr_context ctx) | Tuple(expr* elts, expr_context ctx) | Slice(expr? lower, expr? upper, expr? step)
Expand source code
class typedcomprehension(typedexpr, comprehension): target: typedexpr iter: typedexpr ifs: typing.List[typedexpr]
Ancestors
Class variables
var ifs : List[typedexpr]
var iter : typedexpr
var target : typedexpr
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Inherited from:
typedexpr
.typechecks
Successful typechecks if this expression evaluates to True
class typedexpr (*args, **kwargs)
-
expr = BoolOp(boolop op, expr values) | NamedExpr(expr target, expr value) | BinOp(expr left, operator op, expr right) | UnaryOp(unaryop op, expr operand) | Lambda(arguments args, expr body) | IfExp(expr test, expr body, expr orelse) | Dict(expr keys, expr values) | Set(expr elts) | ListComp(expr elt, comprehension generators) | SetComp(expr elt, comprehension generators) | DictComp(expr key, expr value, comprehension generators) | GeneratorExp(expr elt, comprehension generators) | Await(expr value) | Yield(expr? value) | YieldFrom(expr value) | Compare(expr left, cmpop ops, expr comparators) | Call(expr func, expr args, keyword keywords) | FormattedValue(expr value, int conversion, expr? format_spec) | JoinedStr(expr values) | Constant(constant value, string? kind) | Attribute(expr value, identifier attr, expr_context ctx) | Subscript(expr value, expr slice, expr_context ctx) | Starred(expr value, expr_context ctx) | Name(identifier id, expr_context ctx) | List(expr elts, expr_context ctx) | Tuple(expr* elts, expr_context ctx) | Slice(expr? lower, expr? upper, expr? step)
Expand source code
class typedexpr(TypedAST, expr): def typechecks(self) -> typing.Dict[str, Type]: """Successful typechecks if this expression evaluates to True""" return {}
Ancestors
- TypedAST
- ast.expr
- ast.AST
Subclasses
- RawPlutoExpr
- TypedAttribute
- TypedBinOp
- TypedBoolOp
- TypedCall
- TypedCompare
- TypedDict
- TypedDictComp
- TypedFormattedValue
- TypedJoinedStr
- TypedList
- TypedListComp
- TypedName
- TypedSubscript
- TypedTuple
- TypedUnaryOp
- typedcomprehension
Methods
def typechecks(self) ‑> Dict[str, Type]
-
Successful typechecks if this expression evaluates to True
class typedstmt (*args, **kwargs)
-
stmt = FunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | AsyncFunctionDef(identifier name, arguments args, stmt body, expr decorator_list, expr? returns, string? type_comment) | ClassDef(identifier name, expr bases, keyword keywords, stmt body, expr decorator_list) | Return(expr? value) | Delete(expr targets) | Assign(expr targets, expr value, string? type_comment) | AugAssign(expr target, operator op, expr value) | AnnAssign(expr target, expr annotation, expr? value, int simple) | For(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | AsyncFor(expr target, expr iter, stmt body, stmt orelse, string? type_comment) | While(expr test, stmt body, stmt orelse) | If(expr test, stmt body, stmt orelse) | With(withitem items, stmt body, string? type_comment) | AsyncWith(withitem items, stmt body, string? type_comment) | Match(expr subject, match_case cases) | Raise(expr? exc, expr? cause) | Try(stmt body, excepthandler handlers, stmt orelse, stmt finalbody) | Assert(expr test, expr? msg) | Import(alias names) | ImportFrom(identifier? module, alias names, int? level) | Global(identifier names) | Nonlocal(identifier* names) | Expr(expr value) | Pass | Break | Continue
Expand source code
class typedstmt(TypedAST, stmt): # Statements always have type None typ = NoneInstanceType
Ancestors
- TypedAST
- ast.stmt
- ast.AST
Subclasses
- TypedAnnAssign
- TypedAssert
- TypedAssign
- TypedClassDef
- TypedExpr
- TypedExpression
- TypedFor
- TypedFunctionDef
- TypedIf
- TypedIfExp
- TypedModule
- TypedPass
- TypedReturn
- TypedWhile
Class variables
var typ : Type