On this page
ast.Await
Prev: ast.AugStore | Up: ast | Next: ast.BinOp
Rel: ast.Add, ast.alias, ast.And, ast.AnnAssign
Ref: docs.python.org — ast.Await
Tags: #public #python3 #stdlib #ast
Import
import ast
from ast import Await
Signature & Overview
ast.Await(expr value)
Await(expr value)
Usage
import ast
fn = ast.parse("async def f(x): return await x").body[0]
assert isinstance(fn.body[0].value, ast.Await)
Gotchas
- Only valid inside
async def/ async comprehensions:.valueholds the awaited expression.
REPL Inspect
from ast import Await
help(Await)
Linked from
Related notes
- tuts/python3/stdlib_module/ast/AugStore Linked here; links to this page; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/BinOp Linked here; links to this page; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/Add Linked here; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/alias Linked here; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/And Linked here; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/AnnAssign Linked here; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/AST Linked here; shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ast/arg shared tags: #ast, #stdlib
- tuts/python3/stdlib_module/ast/arguments shared tags: #ast, #stdlib