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 typType

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 typType
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 annotationType
var targettypedexpr
var valuetypedexpr
class TypedAssert (*args, **kwargs)

Assert(expr test, expr? msg)

Expand source code
class TypedAssert(typedstmt, Assert):
    test: typedexpr
    msg: typedexpr

Ancestors

Class variables

var msgtypedexpr
var testtypedexpr
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 valuetypedexpr
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 valuetypedexpr

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 lefttypedexpr
var righttypedexpr

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 functypedexpr

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_typType
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 lefttypedexpr
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 keytypedexpr
var valuetypedexpr

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 valuetypedexpr
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 bodytypedexpr
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 itertypedexpr
var orelse : List[typedstmt]
var targettypedexpr
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 valuetypedexpr

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 argstypedarguments
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 testtypedexpr
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 bodytypedexpr
var orelsetypedexpr
var testtypedexpr
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 elttypedexpr
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 valuetypedexpr
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 valuetypedexpr

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 operandtypedexpr

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 testtypedexpr
class Typedkeyword (*args, **kwargs)

keyword(identifier? arg, expr value)

Expand source code
class Typedkeyword(TypedAST, keyword):
    arg: typedexpr
    value: typedexpr

Ancestors

Class variables

var argtypedexpr
var valuetypedexpr
class typedarg (*args, **kwargs)

arg(identifier arg, expr? annotation, string? type_comment)

Expand source code
class typedarg(TypedAST, arg):
    pass

Ancestors

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

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 itertypedexpr
var targettypedexpr

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

Subclasses

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

Subclasses

Class variables

var typType