CodeQL library for Python
codeql/python-all 2.1.3-dev (changelog, source)
Search

Module Stmts

Import path

import 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)

AssignStmt

An assignment statement

AsyncFor

An asynchronous for statement, such as async for varname in Expr: ...

AsyncWith

An asynchronous with statement, such as async with varname as Expr: ...

AugAssign

An augmented assignment statement, such as x += y

Break

A break statement

Case

A case statement

Continue

A continue statement

Delete

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

ExceptGroupStmt

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

ExceptStmt

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

ExceptionHandler

An exception handler such as an except or an except* statement in a try statement.

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")

MatchStmt

A match statement

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()