💾 Archived View for tris.fyi › pydoc › _ast captured on 2023-04-26 at 13:13:16. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Back to module index

Go to module by name

_ast

This module has no docstring.

Classes

AST

Add

Add

And

And

AnnAssign

AnnAssign(expr target, expr annotation, expr? value, int simple)
end_col_offset = None
end_lineno = None
value = None

Assert

Assert(expr test, expr? msg)
end_col_offset = None
end_lineno = None
msg = None

Assign

Assign(expr* targets, expr value, string? type_comment)
end_col_offset = None
end_lineno = None
type_comment = None

AsyncFor

AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
end_col_offset = None
end_lineno = None
type_comment = None

AsyncFunctionDef

AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)
end_col_offset = None
end_lineno = None
returns = None
type_comment = None

AsyncWith

AsyncWith(withitem* items, stmt* body, string? type_comment)
end_col_offset = None
end_lineno = None
type_comment = None

Attribute

Attribute(expr value, identifier attr, expr_context ctx)
end_col_offset = None
end_lineno = None

AugAssign

AugAssign(expr target, operator op, expr value)
end_col_offset = None
end_lineno = None

Await

Await(expr value)
end_col_offset = None
end_lineno = None

BinOp

BinOp(expr left, operator op, expr right)
end_col_offset = None
end_lineno = None

BitAnd

BitAnd

BitOr

BitOr

BitXor

BitXor

BoolOp

BoolOp(boolop op, expr* values)
end_col_offset = None
end_lineno = None

Break

Break
end_col_offset = None
end_lineno = None

Call

Call(expr func, expr* args, keyword* keywords)
end_col_offset = None
end_lineno = None

ClassDef

ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)
end_col_offset = None
end_lineno = None

Compare

Compare(expr left, cmpop* ops, expr* comparators)
end_col_offset = None
end_lineno = None

Constant

Constant(constant value, string? kind)
end_col_offset = None
end_lineno = None
kind = None
n = <property object at 0x7f75e39d1580>
  Deprecated. Use value instead.
s = <property object at 0x7f75e39d3290>
  Deprecated. Use value instead.

Continue

Continue
end_col_offset = None
end_lineno = None

Del

Del

Delete

Delete(expr* targets)
end_col_offset = None
end_lineno = None

Dict

Dict(expr* keys, expr* values)
end_col_offset = None
end_lineno = None

DictComp

DictComp(expr key, expr value, comprehension* generators)
end_col_offset = None
end_lineno = None

Div

Div

Eq

Eq

ExceptHandler

ExceptHandler(expr? type, identifier? name, stmt* body)
end_col_offset = None
end_lineno = None
name = None
type = None

Expr

Expr(expr value)
end_col_offset = None
end_lineno = None

Expression

Expression(expr body)

FloorDiv

FloorDiv

For

For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)
end_col_offset = None
end_lineno = None
type_comment = None

FormattedValue

FormattedValue(expr value, int conversion, expr? format_spec)
end_col_offset = None
end_lineno = None
format_spec = None

FunctionDef

FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)
end_col_offset = None
end_lineno = None
returns = None
type_comment = None

FunctionType

FunctionType(expr* argtypes, expr returns)

GeneratorExp

GeneratorExp(expr elt, comprehension* generators)
end_col_offset = None
end_lineno = None

Global

Global(identifier* names)
end_col_offset = None
end_lineno = None

Gt

Gt

GtE

GtE

If

If(expr test, stmt* body, stmt* orelse)
end_col_offset = None
end_lineno = None

IfExp

IfExp(expr test, expr body, expr orelse)
end_col_offset = None
end_lineno = None

Import

Import(alias* names)
end_col_offset = None
end_lineno = None

ImportFrom

ImportFrom(identifier? module, alias* names, int? level)
end_col_offset = None
end_lineno = None
level = None
module = None

In

In

Interactive

Interactive(stmt* body)

Invert

Invert

Is

Is

IsNot

IsNot

JoinedStr

JoinedStr(expr* values)
end_col_offset = None
end_lineno = None

LShift

LShift

Lambda

Lambda(arguments args, expr body)
end_col_offset = None
end_lineno = None

List

List(expr* elts, expr_context ctx)
end_col_offset = None
end_lineno = None

ListComp

ListComp(expr elt, comprehension* generators)
end_col_offset = None
end_lineno = None

Load

Load

Lt

Lt

LtE

LtE

MatMult

MatMult

Match

Match(expr subject, match_case* cases)
end_col_offset = None
end_lineno = None

MatchAs

MatchAs(pattern? pattern, identifier? name)
name = None
pattern = None

MatchClass

MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)

MatchMapping

MatchMapping(expr* keys, pattern* patterns, identifier? rest)
rest = None

MatchOr

MatchOr(pattern* patterns)

MatchSequence

MatchSequence(pattern* patterns)

MatchSingleton

MatchSingleton(constant value)

MatchStar

MatchStar(identifier? name)
name = None

MatchValue

MatchValue(expr value)

Mod

Mod

Module

Module(stmt* body, type_ignore* type_ignores)

Mult

Mult

Name

Name(identifier id, expr_context ctx)
end_col_offset = None
end_lineno = None

NamedExpr

NamedExpr(expr target, expr value)
end_col_offset = None
end_lineno = None

Nonlocal

Nonlocal(identifier* names)
end_col_offset = None
end_lineno = None

Not

Not

NotEq

NotEq

NotIn

NotIn

Or

Or

Pass

Pass
end_col_offset = None
end_lineno = None

Pow

Pow

RShift

RShift

Raise

Raise(expr? exc, expr? cause)
cause = None
end_col_offset = None
end_lineno = None
exc = None

Return

Return(expr? value)
end_col_offset = None
end_lineno = None
value = None

Set

Set(expr* elts)
end_col_offset = None
end_lineno = None

SetComp

SetComp(expr elt, comprehension* generators)
end_col_offset = None
end_lineno = None

Slice

Slice(expr? lower, expr? upper, expr? step)
end_col_offset = None
end_lineno = None
lower = None
step = None
upper = None

Starred

Starred(expr value, expr_context ctx)
end_col_offset = None
end_lineno = None

Store

Store

Sub

Sub

Subscript

Subscript(expr value, expr slice, expr_context ctx)
end_col_offset = None
end_lineno = None

Try

Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
end_col_offset = None
end_lineno = None

Tuple

Tuple(expr* elts, expr_context ctx)
dims = <property object at 0x7f75e32d6d40>
  Deprecated. Use elts instead.
end_col_offset = None
end_lineno = None

TypeIgnore

TypeIgnore(int lineno, string tag)

UAdd

UAdd

USub

USub

UnaryOp

UnaryOp(unaryop op, expr operand)
end_col_offset = None
end_lineno = None

While

While(expr test, stmt* body, stmt* orelse)
end_col_offset = None
end_lineno = None

With

With(withitem* items, stmt* body, string? type_comment)
end_col_offset = None
end_lineno = None
type_comment = None

Yield

Yield(expr? value)
end_col_offset = None
end_lineno = None
value = None

YieldFrom

YieldFrom(expr value)
end_col_offset = None
end_lineno = None

alias

alias(identifier name, identifier? asname)
asname = None
end_col_offset = None
end_lineno = None

arg

arg(identifier arg, expr? annotation, string? type_comment)
annotation = None
end_col_offset = None
end_lineno = None
type_comment = None

arguments

arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)
kwarg = None
vararg = None

boolop

boolop = And | Or

cmpop

cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn

comprehension

comprehension(expr target, expr iter, expr* ifs, int is_async)

excepthandler

excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)
end_col_offset = None
end_lineno = None

expr

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)
end_col_offset = None
end_lineno = None

expr_context

expr_context = Load | Store | Del

keyword

keyword(identifier? arg, expr value)
arg = None
end_col_offset = None
end_lineno = None

match_case

match_case(pattern pattern, expr? guard, stmt* body)
guard = None

mod

mod = Module(stmt* body, type_ignore* type_ignores)
    | Interactive(stmt* body)
    | Expression(expr body)
    | FunctionType(expr* argtypes, expr returns)

operator

operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift | RShift | BitOr | BitXor | BitAnd | FloorDiv

pattern

pattern = MatchValue(expr value)
        | MatchSingleton(constant value)
        | MatchSequence(pattern* patterns)
        | MatchMapping(expr* keys, pattern* patterns, identifier? rest)
        | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)
        | MatchStar(identifier? name)
        | MatchAs(pattern? pattern, identifier? name)
        | MatchOr(pattern* patterns)

stmt

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
end_col_offset = None
end_lineno = None

type_ignore

type_ignore = TypeIgnore(int lineno, string tag)

unaryop

unaryop = Invert | Not | UAdd | USub

withitem

withitem(expr context_expr, expr? optional_vars)
optional_vars = None

Other members

PyCF_ALLOW_TOP_LEVEL_AWAIT = 8192
PyCF_ONLY_AST = 1024
PyCF_TYPE_COMMENTS = 4096