Module Stmts

Import path

semmle.python.Stmts

Imports

Classes

AnnAssign

An annotated assignment statement, such as x: int = 0

Assert

An assert statement, such as assert a == b, "A is not equal to b"

Assign

A statement that includes a binding (except imports)

AsyncFor
AsyncWith
AugAssign

An augmented assignment statement, such as x += y

Break

A break statement

Continue

A continue statement

Delete

A delete statement, such as del x[-1]

ExceptStmt

An except statement (part of a try statement), such as except IOError as err:

Exec

An exec statement

ExprStmt

An expression statement, such as len(x) or yield y

For

A for statement, such as for x in y: print(x)

Global

A global statement, such as global var

If

An if statement, such as if eggs: print("spam")

Nonlocal

A nonlocal statement, such as nonlocal var

Pass

A pass statement

Print

A print statement (Python 2 only), such as print 0

Raise

A raise statement, such as raise CompletelyDifferentException()

Return

A return statement, such as return None

Stmt

A statement

StmtList

A list of statements

TemplateWrite

A plain text used in a template is wrapped in a TemplateWrite statement

Try

A try statement

While

A while statement, such as while parrot_resting():

With

A with statement such as with f as open("file"): text = f.read()