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

Module python

Import path

import python

Predicates

attribute_assigned_in_method
class_declares_attribute

Holds if this class (not on a super-class) declares name

globallyDefinedName

Whether this name is (almost) always defined, ie. it is a builtin or VM defined name

import_from_dot_in_init

Holds if f is an import of the form from .[...] import ... and the enclosing scope is an init module

isPreferredModuleForName

Holds if the Container c should be the preferred file or folder for the given name when performing imports. Trivially true for any container if it is the only one with its name. However, if there are several modules with the same name, then this is the module most likely to be imported under that name.

legalShortName
major_version

the Python major version number

micro_version

the Python micro version number

minor_version

the Python minor version number

moduleNameFromFile

Gets the name of the module that c resolves to, if any.

nested_sequence_assign
non_coupling_method
object_for_string

Primarily for internal use.

scope_raises

INTERNAL – Use FunctionObject.getARaisedType() instead

scope_raises_objectapi

INTERNAL – Use FunctionObject.getARaisedType() instead

scope_raises_unknown

INTERNAL – Use FunctionObject.raisesUnknownType() instead

test_contains

Hold if expr is a test (a branch) and use is within that test

theAbcMetaClassObject
theAttributeErrorType

Gets the builtin class ‘AttributeError’

theBaseExceptionType

Gets the builtin class ‘BaseException’

theBoolType

Gets the built-in class ‘bool’

theBoundMethodType

Gets the builtin class of bound methods

theBuiltinFunctionType

Gets the class of builtin-functions

theBuiltinModuleObject

Gets the builtin module

theBuiltinPropertyType

Gets the class of builtin properties

theBytesType

Gets the builtin class for bytes. str in Python2, bytes in Python3

theClassMethodType

Gets the builtin class ‘classmethod’

theClassType

Gets the builtin object ClassType (for old-style classes)

theComplexType

Gets the builtin class ‘complex’

theDictType

Gets the builtin class ‘dict’

theExceptionType

Gets the builtin class ‘Exception’

theFalseObject

Gets the built-in object False

theFloatType

Gets the builtin class ‘float’

theGeneratorType

Gets the class of generators

theGetSetDescriptorType

Gets the builtin class of builtin properties

theIOErrorType

Gets the builtin class ‘IOError’

theIndexErrorType

Gets the IndexError class

theInstanceType

Gets the builtin object InstanceType (for old-style classes)

theIntType

Gets the builtin class ‘int’

theKeyErrorType

Gets the builtin class ‘KeyError’

theListType

Gets the builtin class ‘list’

theLongType

Gets the builtin class ‘long’ (Python 2 only)

theLookupErrorType

Gets the LookupError class

theMethodDescriptorType

Gets the method descriptor class

theModuleType

Gets the class of modules

theNameErrorType

Gets the NameError class

theNoneObject

Gets the built-in object None

theNoneType

Gets the built-in class NoneType

theNotImplementedErrorType

Gets the builtin class ‘NotImplementedError’

theObjectType

Gets the builtin class ‘object’

thePropertyType

Gets the builtin class ‘property’

thePyFunctionType

Gets the class of Python functions

theRangeType

Gets the builtin class ‘(x)range’

theSetType

Gets the builtin class ‘set’

theStandardErrorType

Gets the StandardError class

theStaticMethodType

Gets the builtin class ‘staticmethod’

theStopIterationType

Gets the builtin class ‘StopIteration’

theStrType

Gets the ‘str’ class. This is the same as the ‘bytes’ class for Python 2 and the ‘unicode’ class for Python 3

theSuperType

Gets the builtin class ‘super’

theSysModuleObject

Gets the sys module

theTrueObject

Gets the built-in object True

theTupleType

Gets the builtin class ‘tuple’

theTypeErrorType

Gets the builtin class ‘TypeError’

theTypeType

Gets the builtin class ‘type’

theUnicodeType

Gets the builtin class for unicode. unicode in Python2, str in Python3

theUnknownType
undefinedVariable

Gets the pseudo-object representing the value referred to by an undefined variable

unique_root_method

Helpers for coupling

unknownValue

Gets the pseudo-object representing an unknown value

Classes

Add

An add (+) binary operator

Add_

INTERNAL: See the class Add for further information.

Alias

An alias in an import statement, the mod as name part of import mod as name. May be artificial; import x is transformed into import x as x

AliasList

A list of aliases in an import statement

AliasList_

INTERNAL: See the class AliasList for further information.

Alias_

INTERNAL: See the class Alias for further information.

And

An and boolean operator

And_

INTERNAL: See the class And for further information.

AnnAssign

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

AnnAssign_

INTERNAL: See the class AnnAssign for further information.

ArgumentRefinement

A use of a variable as an argument, foo(v), which might modify the object referred to.

Arguments

The default values and annotations (type hints) for the arguments in a function definition.

ArgumentsParent

The parent of an Arguments node. Internal implementation class

ArgumentsParent_

INTERNAL: See the class ArgumentsParent for further information.

Arguments_

INTERNAL: See the class Arguments for further information.

Assert

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

Assert_

INTERNAL: See the class Assert for further information.

Assign

A statement that includes a binding (except imports)

AssignExpr

An assignment expression, such as x := y

AssignExpr_

INTERNAL: See the class AssignExpr for further information.

AssignStmt

An assignment statement

Assign_

INTERNAL: See the class Assign for further information.

AssignmentDefinition

An assignment to a variable v = val

AssignmentExprNode

A control flow node corresponding to an assignment expression such as lhs := rhs.

AstNode

A syntactic node (Class, Function, Module, Expr, Stmt or Comprehension) corresponding to a flow node

AstNode_

INTERNAL: See the class AstNode for further information.

AsyncFor

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

AsyncWith

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

AttrNode

A control flow corresponding to an attribute expression, such as value.attr

Attribute

An attribute expression, such as value.attr

AttributeAssignment

An assignment of an attribute obj.attr = val

Attribute_

INTERNAL: See the class Attribute for further information.

AugAssign

An augmented assignment statement, such as x += y

AugAssign_

INTERNAL: See the class AugAssign for further information.

AugLoad

The context of an augmented load. This is an artifact of the Python grammar which includes an AugLoad context, even though it is never used.

AugLoad_

INTERNAL: See the class AugLoad for further information.

AugStore

The augmented store context, the context of var in var += 1

AugStore_

INTERNAL: See the class AugStore for further information.

Await

An await expression such as await coro.

Await_

INTERNAL: See the class Await for further information.

BasicBlock

A basic block (ignoring exceptional flow edges to scope exit)

BinaryExpr

A binary expression, such as x + y

BinaryExprNode

A control flow node corresponding to a binary expression, such as x + y

BinaryExpr_

INTERNAL: See the class BinaryExpr for further information.

BitAnd

A bitwise and (&) binary operator

BitAnd_

INTERNAL: See the class BitAnd for further information.

BitOr

A bitwise or (|) binary operator

BitOr_

INTERNAL: See the class BitOr for further information.

BitXor

A bitwise exclusive-or (^) binary operator

BitXor_

INTERNAL: See the class BitXor for further information.

BoolExpr

A boolean shortcut (and/or) operation

BoolExprNode

A control flow node corresponding to a boolean shortcut (and/or) operation

BoolExpr_

INTERNAL: See the class BoolExpr for further information.

BoolParent_

INTERNAL: See the class BoolParent for further information.

BooleanLiteral

A boolean named constant, either True or False

Boolop

A short circuit boolean operator, and/or

Boolop_

INTERNAL: See the class Boolop for further information.

BoundMethodValue

A bound-method, such as o.func, where o is an instance of a class that has a callable attribute func.

Break

A break statement

Break_

INTERNAL: See the class Break for further information.

BuiltinCallable
BuiltinFunctionObject
BuiltinFunctionValue

A builtin function, such as len or print.

BuiltinMethodObject
BuiltinMethodValue

A builtin method, such as list.append or set.add

BuiltinModuleObject
BuiltinPropertyObject
BuiltinVariable
Bytes

A bytes constant, such as b'ascii'. Note that unadorned string constants such as "hello" are treated as Bytes for Python2, but Unicode for Python3.

BytesOrStr
BytesOrStr_

INTERNAL: See the class BytesOrStr for further information.

Bytes_

INTERNAL: See the class Bytes for further information.

Call

A call expression, such as func(...)

CallNode

A control flow node corresponding to a call expression, such as func(...)

Call_

INTERNAL: See the class Call for further information.

CallableExpr

An expression that generates a callable object, either a function expression or a lambda

CallableValue

A callable in the Python program. Callables include Python functions, built-in functions and bound-methods, but not classes.

CallsiteRefinement

An implicit (possible) definition of an escaping variable at a call-site

Case

A case statement

Case_

INTERNAL: See the class Case for further information.

Class

The scope of a class. This is the scope of all the statements within the class definition

ClassDef

A class statement. Note that ClassDef extends Assign as a class definition binds the newly created class

ClassExpr

An (artificial) expression corresponding to a class definition. It is recommended to use ClassDef instead.

ClassExpr_

INTERNAL: See the class ClassExpr for further information.

ClassLocalVariable
ClassMethodObject

A class method object. Either a decorated function or an explicit call to classmethod(f)

ClassMetrics

The metrics for a class

ClassObject

A class whose instances represents Python classes. Instances of this class represent either builtin classes such as list or str, or program-defined Python classes present in the source code.

ClassValue

A class in the Python program, both Python and built-in.

Class_

INTERNAL: See the class Class for further information.

Cmpop

A comparison operator

CmpopList

A list of comparison operators in a comparison

CmpopList_

INTERNAL: See the class CmpopList for further information.

Cmpop_

INTERNAL: See the class Cmpop for further information.

Comment

A source code comment

CommentBlock

A block of consecutive comments

Comp

The base class for list, set and dictionary comprehensions, and generator expressions.

Compare

A comparison operation, such as x<y

CompareNode

A control flow node corresponding to a comparison operation, such as x<y

Compare_

INTERNAL: See the class Compare for further information.

Comprehension

A comprehension part, the ‘for a in seq’ part of [ a * a for a in seq ]

ComprehensionList

A list of Comprehensions (for generating parts of a set, list or dictionary comprehension)

ComprehensionList_

INTERNAL: See the class ComprehensionList for further information.

Comprehension_

INTERNAL: See the class Comprehension for further information.

ConditionBlock

A basic block which terminates in a condition, splitting the subsequent control flow

Container

A container is an abstract representation of a file system object that can hold elements of interest.

Continue

A continue statement

Continue_

INTERNAL: See the class Continue for further information.

ControlFlowNode

A control flow node. Control flow nodes have a many-to-one relation with syntactic nodes, although most syntactic nodes have only one corresponding control flow node. Edges between control flow nodes include exceptional as well as normal control flow.

DefinitionNode

A control flow node corresponding to a definition, that is a control flow node where a value is assigned to this node. Includes control flow nodes for the targets of assignments, simple or augmented, and nodes implicitly assigned in class and function definitions and imports.

Del

The delete context, the context of var in del var

Del_

INTERNAL: See the class Del for further information.

Delete

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

Delete_

INTERNAL: See the class Delete for further information.

DeletionDefinition

A deletion of a variable del v

DeletionNode

A control flow node corresponding to a deletion statement, such as del x. There can be multiple DeletionNodes for each Delete such that each target has own DeletionNode. The CFG for del a, x.y looks like: NameNode('a') -> DeletionNode -> NameNode('b') -> AttrNode('y') -> DeletionNode.

Dict

A dictionary expression, such as {'key':'value'}

DictComp

A dictionary comprehension, such as { k:v for k, v in enumerate("0123456789") }

DictComp_

INTERNAL: See the class DictComp for further information.

DictDisplayItem
DictItem
DictItemList
DictItemListParent
DictItemListParent_

INTERNAL: See the class DictItemListParent for further information.

DictItemList_

INTERNAL: See the class DictItemList for further information.

DictItem_

INTERNAL: See the class DictItem for further information.

DictNode

A control flow node corresponding to a dictionary literal, such as { 'a': 1, 'b': 2 }

DictUnpacking

A double-starred expression in a call or dict literal.

DictUnpackingOrKeyword
DictUnpacking_

INTERNAL: See the class DictUnpacking for further information.

Dict_

INTERNAL: See the class Dict for further information.

Div

An (true) divide (/) binary operator

Div_

INTERNAL: See the class Div for further information.

Ellipsis

An ellipsis expression, such as ...

Ellipsis_

INTERNAL: See the class Ellipsis for further information.

EncodingError

An encoding error. Note that if there is an encoding error in a module, much information about that module will be lost

Eq

An equals (==) comparison operator

Eq_

INTERNAL: See the class Eq for further information.

EscapingAssignmentGlobalVariable
EscapingGlobalVariable
EssaAttributeDeletion

A deletion of an attribute del obj.attr.

EssaDefinition

A definition of an extended-SSA (ESSA) variable. There is exactly one definition for each variable, and exactly one variable for each definition.

EssaEdgeRefinement

An ESSA definition corresponding to an edge refinement of the underlying variable. For example, the edges leaving a test on a variable both represent refinements of that variable. On one edge the test is true, on the other it is false.

EssaNodeDefinition

A definition of an ESSA variable that is not directly linked to another ESSA variable.

EssaNodeRefinement

A definition of an ESSA variable that takes another ESSA variable as an input.

EssaVariable

An (enhanced) SSA variable derived from SsaSourceVariable.

ExceptFlowNode

The ControlFlowNode for an ‘except’ statement.

ExceptGroupFlowNode

The ControlFlowNode for an ‘except*’ statement.

ExceptGroupStmt

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

ExceptGroupStmt_

INTERNAL: See the class ExceptGroupStmt for further information.

ExceptStmt

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

ExceptStmt_

INTERNAL: See the class ExceptStmt for further information.

ExceptionCapture

A capture of a raised exception except ExceptionType as ex:

ExceptionGroupCapture

A capture of a raised exception group except* ExceptionType as ex:

ExceptionHandler

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

Exec

An exec statement

Exec_

INTERNAL: See the class Exec for further information.

Expr

An expression

ExprContext

A context in which an expression used

ExprContextParent

The parent of an ExprContext. Internal implementation class

ExprContextParent_

INTERNAL: See the class ExprContextParent for further information.

ExprContext_

INTERNAL: See the class ExprContext for further information.

ExprList

A list of expressions

ExprListParent

The parent of an ExprList. Internal implementation class

ExprListParent_

INTERNAL: See the class ExprListParent for further information.

ExprList_

INTERNAL: See the class ExprList for further information.

ExprOrStmt_

INTERNAL: See the class ExprOrStmt for further information.

ExprParent

The parent of an Expr. Internal implementation class

ExprParent_

INTERNAL: See the class ExprParent for further information.

ExprStmt

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

ExprStmt_

INTERNAL: See the class ExprStmt for further information.

Expr_

INTERNAL: See the class Expr for further information.

False

The boolean named constant False

FastLocalVariable

A local variable that uses “load fast” semantics, for lookup: If the variable is undefined, then raise an exception.

FastLocalsFunction

A function that uses ‘fast’ locals, stored in the frame not in a dictionary.

File

A file

Filter
Filter_

INTERNAL: See the class Filter for further information.

FloatLiteral

A floating point numeric constant, such as 0.4 or 4e3

FloorDiv

An floor divide (//) binary operator

FloorDiv_

INTERNAL: See the class FloorDiv for further information.

Folder

A folder (directory)

For

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

ForNode

A flow node for a for statement.

For_

INTERNAL: See the class For for further information.

FormattedValue

A formatted value (within a formatted string literal). For example, in the string f'hello {world!s}' the formatted value is world!s.

FormattedValue_

INTERNAL: See the class FormattedValue for further information.

Fstring

A formatted string literal expression, such as f'hello {world!s}'

Fstring_

INTERNAL: See the class Fstring for further information.

Function

A function, independent of defaults and binding. It is the syntactic entity that is compiled to a code object.

FunctionDef

A def statement. Note that FunctionDef extends Assign as a function definition binds the newly created function

FunctionExpr

An (artificial) expression corresponding to a function definition.

FunctionExpr_

INTERNAL: See the class FunctionExpr for further information.

FunctionInvocation

A function invocation.

FunctionLocalVariable
FunctionMetrics

The metrics for a function

FunctionObject

A function object, whether written in Python or builtin

FunctionParent

The parent of a Function. Internal implementation class

FunctionParent_

INTERNAL: See the class FunctionParent for further information.

FunctionValue

A function in the Python program, both Python and built-in. Note that this does not include other callables such as bound-methods.

Function_

INTERNAL: See the class Function for further information.

GeneratorExp

A generator expression, such as (var for var in iterable)

GeneratorExp_

INTERNAL: See the class GeneratorExp for further information.

Global

A global statement, such as global var

GlobalSsaVariable

An SSA variable that is backed by a global variable

GlobalVariable

A global (module-level) variable

Global_

INTERNAL: See the class Global for further information.

Gt

A greater than (>) comparison operator

GtE

A greater than or equals (>=) comparison operator

GtE_

INTERNAL: See the class GtE for further information.

Gt_

INTERNAL: See the class Gt for further information.

Guard

A guard in a case statement

Guard_

INTERNAL: See the class Guard for further information.

If

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

IfExp

A conditional expression such as, body if test else orelse

IfExp_

INTERNAL: See the class IfExp for further information.

IfExprNode

A control flow node corresponding to a conditional expression such as, body if test else orelse

If_

INTERNAL: See the class If for further information.

ImaginaryLiteral

An imaginary numeric constant, such as 3j

ImmutableLiteral

An immutable literal expression (except tuples). Consists of string (both unicode and byte) literals and numeric literals.

ImplicitSubModuleDefinition

An implicit definition of the names of sub-modules in a package. Although the interpreter does not pre-define these names, merely populating them as they are imported, this is a good approximation for static analysis.

Import

An import statement

ImportExpr

An artificial expression representing an import

ImportExprNode

A control flow node corresponding to an artificial expression representing an import

ImportExpr_

INTERNAL: See the class ImportExpr for further information.

ImportMember

A from ... import ... expression

ImportMemberNode

A control flow node corresponding to a from ... import ... expression

ImportMember_

INTERNAL: See the class ImportMember for further information.

ImportStar

An import * statement

ImportStarNode

A control flow node corresponding to a from ... import * statement

ImportStarRefinement

A possible redefinition of variable via from ... import *

ImportStar_

INTERNAL: See the class ImportStar for further information.

ImportTimeScope

An ImportTimeScope is any scope that is not nested within a function and will thus be executed if its enclosing module is imported. Note however, that if a scope is not an ImportTimeScope it may still be executed at import time. This is an artificial approximation, which is necessary for static analysis.

Import_

INTERNAL: See the class Import for further information.

ImportingStmt

A statement that imports a module. This can be any statement that includes the import keyword, such as import sys, from sys import version or from sys import *.

In

An in comparison operator

In_

INTERNAL: See the class In for further information.

IntegerLiteral

An integer numeric constant, such as 7 or 0x9

Invert

An invert (~) unary operator

Invert_

INTERNAL: See the class Invert for further information.

Is

An is comparison operator

IsNot

An is not comparison operator

IsNot_

INTERNAL: See the class IsNot for further information.

Is_

INTERNAL: See the class Is for further information.

IterableNode

A control flow node corresponding to an iterable literal. Currently does not include dictionaries, use DictNode directly instead.

KeyValuePair
KeyValuePair_

INTERNAL: See the class KeyValuePair for further information.

Keyword

A keyword argument in a call. For example arg=expr in foo(0, arg=expr)

Keyword_

INTERNAL: See the class Keyword for further information.

LShift

A left shift (<<) binary operator

LShift_

INTERNAL: See the class LShift for further information.

Lambda

A lambda expression, such as lambda x: x+1

Lambda_

INTERNAL: See the class Lambda for further information.

Line

A non-empty line in the source code

List

A list expression, such as [ 1, 3, 5, 7, 9 ]

ListComp

A list comprehension, such as [ chr(x) for x in range(ord('A'), ord('Z')+1) ]

ListComp_

INTERNAL: See the class ListComp for further information.

ListNode

A control flow node corresponding to a list expression, such as [ 1, 3, 5, 7, 9 ]

ListObject
List_

INTERNAL: See the class List for further information.

Load

The load context, the context of var in len(var)

Load_

INTERNAL: See the class Load for further information.

LocalVariable

A local (function or class) variable

Location
LocationParent_

INTERNAL: See the class LocationParent for further information.

Lt

A less than (<) comparison operator

LtE

A less than or equals (<=) comparison operator

LtE_

INTERNAL: See the class LtE for further information.

Lt_

INTERNAL: See the class Lt for further information.

MRO

A method-resolution-order sequence of classes

MatMult

A matrix multiplication (@) binary operator

MatMult_

INTERNAL: See the class MatMult for further information.

MatchAsPattern

An as-pattern in a match statement: <subpattern> as alias

MatchAsPattern_

INTERNAL: See the class MatchAsPattern for further information.

MatchCapturePattern

A capture pattern in a match statement: var

MatchCapturePattern_

INTERNAL: See the class MatchCapturePattern for further information.

MatchClassPattern

A class pattern in a match statement: Circle(radius = 3)

MatchClassPattern_

INTERNAL: See the class MatchClassPattern for further information.

MatchDoubleStarPattern

A double star pattern in a match statement: {..., **}

MatchDoubleStarPattern_

INTERNAL: See the class MatchDoubleStarPattern for further information.

MatchKeyValuePattern

A key-value pattern inside a mapping pattern: a: var

MatchKeyValuePattern_

INTERNAL: See the class MatchKeyValuePattern for further information.

MatchKeywordPattern

A keyword pattern inside a class pattern: radius = 3

MatchKeywordPattern_

INTERNAL: See the class MatchKeywordPattern for further information.

MatchLiteralPattern

A literal pattern in a match statement: 42

MatchLiteralPattern_

INTERNAL: See the class MatchLiteralPattern for further information.

MatchMappingPattern

A mapping pattern in a match statement: {'a': var}

MatchMappingPattern_

INTERNAL: See the class MatchMappingPattern for further information.

MatchOrPattern

An or-pattern in a match statement: (<pattern1>|<pattern2>)

MatchOrPattern_

INTERNAL: See the class MatchOrPattern for further information.

MatchSequencePattern

A sequence pattern in a match statement <p1>, <p2>

MatchSequencePattern_

INTERNAL: See the class MatchSequencePattern for further information.

MatchStarPattern

A star pattern in a match statement: (..., *)

MatchStarPattern_

INTERNAL: See the class MatchStarPattern for further information.

MatchStmt

A match statement

MatchStmt_

INTERNAL: See the class MatchStmt for further information.

MatchValuePattern

A value pattern in a match statement: Http.OK

MatchValuePattern_

INTERNAL: See the class MatchValuePattern for further information.

MatchWildcardPattern

A wildcard pattern in a match statement: _

MatchWildcardPattern_

INTERNAL: See the class MatchWildcardPattern for further information.

MethodCallsiteRefinement

An implicit (possible) modification of the object referred at a method call

Mod

A modulo (%) binary operator, which includes string formatting

Mod_

INTERNAL: See the class Mod for further information.

Module

A module. This is the top level element in an AST, corresponding to a source file. It is also a Scope; the scope of global variables.

ModuleMetrics
ModuleObject
ModuleValue

A module in the Python program. Each ModuleValue represents a module object in the Python program.

ModuleVariable
Module_

INTERNAL: See the class Module for further information.

Mult

A multiplication (*) binary operator

Mult_

INTERNAL: See the class Mult for further information.

MultiAssignmentDefinition

An assignment to a variable as part of a multiple assignment ..., v, ... = val

Name

A (plain variable) name expression, such as var. None, True and False are excluded.

NameConstant

A named constant, one of None, True or False

NameConstantNode

A control flow node corresponding to a named constant, one of None, True or False.

NameLocalVariable

A local variable that uses “load name” semantics, for lookup: If the variable is undefined, then lookup the value in globals().

NameNode

A control flow node corresponding to a (plain variable) name expression, such as var. None, True and False are excluded.

Name_

INTERNAL: See the class Name for further information.

NegativeIntegerLiteral
NonEmptyTupleObject
NonEscapingGlobalVariable
NonLocalVariable
None

The None constant.

Nonlocal

A nonlocal statement, such as nonlocal var

Nonlocal_

INTERNAL: See the class Nonlocal for further information.

Not

A not unary operator

NotEq

A not equals (!=) comparison operator

NotEq_

INTERNAL: See the class NotEq for further information.

NotIn

An not in comparison operator

NotIn_

INTERNAL: See the class NotIn for further information.

Not_

INTERNAL: See the class Not for further information.

Num

A numerical constant expression, such as 7 or 4.2

Num_

INTERNAL: See the class Num for further information.

NumericObject

A numeric object (int or float). Includes those occurring in the source as a literal or in a builtin module as a value.

NumericValue

A class representing numbers (ints and floats), either present in the source as a literal, or in a builtin as a value.

Object

An object.

Operator

The base class for operators

Operator_

INTERNAL: See the class Operator for further information.

Or

An or boolean operator

Or_

INTERNAL: See the class Or for further information.

PackageObject
Param

The parameter context, the context of var in def f(var): pass

ParamSpec

A param spec parameter, such as **T1 in type T[**T1] = T2.

ParamSpec_

INTERNAL: See the class ParamSpec for further information.

Param_

INTERNAL: See the class Param for further information.

Parameter

A parameter. Either a Tuple or a Name (always a Name for Python 3)

ParameterDefinition

A definition of a variable by declaring it as a parameter

ParameterList

A parameter list

Parameter_

INTERNAL: See the class Parameter for further information.

Pass

A pass statement

Pass_

INTERNAL: See the class Pass for further information.

Pattern

A pattern in a match statement

PatternAliasDefinition

A definition of a variable via a pattern alias

PatternCaptureDefinition

A definition of a variable via a capture pattern

PatternList

A list of patterns

PatternListParent

The parent of a PatternList. Internal implementation class

PatternListParent_

INTERNAL: See the class PatternListParent for further information.

PatternList_

INTERNAL: See the class PatternList for further information.

PatternParent

The parent of a Pattern. Internal implementation class

PatternParent_

INTERNAL: See the class PatternParent for further information.

Pattern_

INTERNAL: See the class Pattern for further information.

PhiFunction

A Phi-function as specified in classic SSA form.

PlaceHolder
PlaceHolder_

INTERNAL: See the class PlaceHolder for further information.

Pow

A power (**) binary operator

Pow_

INTERNAL: See the class Pow for further information.

Print

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

Print_

INTERNAL: See the class Print for further information.

PropertyObject

A Python property:

PropertyValue

A Python property:

PyEdgeRefinement

A Python specific sub-class of generic EssaEdgeRefinement

PyFunctionObject
PythonFunctionValue

A Python function.

PythonModuleObject
PythonPropertyObject
RShift

A right shift (>>) binary operator

RShift_

INTERNAL: See the class RShift for further information.

Raise

A raise statement, such as raise CompletelyDifferentException()

RaiseStmtNode

A flow node for a raise statement

Raise_

INTERNAL: See the class Raise for further information.

RaisingNode

The subset of ControlFlowNodes which might raise an exception

Repr

A repr (backticks) expression, such as `value`

Repr_

INTERNAL: See the class Repr for further information.

ReraisingNode

A Reraising node is the node at the end of a finally block (on the exceptional branch) that reraises the current exception.

Return

A return statement, such as return None

Return_

INTERNAL: See the class Return for further information.

Scope

A Scope. A scope is the lexical extent over which all identifiers with the same name refer to the same variable. Modules, Classes and Functions are all Scopes. There are no other scopes. The scopes for expressions that create new scopes, lambdas and comprehensions, are handled by creating an anonymous Function.

ScopeEntryDefinition

A definition of variable at the entry of a scope. Usually this represents the transfer of a global or non-local variable from one scope to another.

Scope_

INTERNAL: See the class Scope for further information.

SelfAttribute

An attribute access where the left hand side of the attribute expression is self.

SelfAttributeRead

A helper class for UndefinedClassAttribute.ql & MaybeUndefinedClassAttribute.ql

SelfAttributeStore
SelfCallsiteRefinement

An implicit (possible) modification of self at a method call

SequenceNode

A control flow node corresponding to a sequence (tuple or list) literal

SequenceObject

A sequence object (list or tuple) Includes those occurring in the source as a literal or in a builtin module as a value.

SequenceValue

A class representing sequence objects with a length and tracked items.

Set

A set expression such as { 1, 3, 5, 7, 9 }

SetComp

A set comprehension such as { v for v in "0123456789" }

SetComp_

INTERNAL: See the class SetComp for further information.

SetNode

A control flow node corresponding to a set expression, such as { 1, 3, 5, 7, 9 }

Set_

INTERNAL: See the class Set for further information.

SingleSuccessorGuard

A pi-node (guard) with only one successor.

Slice

A slice. E.g 0:1 in the expression x[0:1]

Slice_

INTERNAL: See the class Slice for further information.

SpecialOperation_

INTERNAL: See the class SpecialOperation for further information.

SpecialSsaSourceVariable
SsaSourceVariable

A source language variable, to be converted into a set of SSA variables.

SsaVariable

A single static assignment variable. An SSA variable is a variable which is only assigned once (statically). SSA variables can be defined as normal variables or by a phi node which can occur at joins in the flow graph. Definitions without uses do not have a SSA variable.

Starred

A starred expression, such as the *rest in the assignment first, *rest = seq

StarredNode

A control flow node corresponding to a starred expression, *a.

Starred_

INTERNAL: See the class Starred for further information.

StaticMethodObject

A static method object. Either a decorated function or an explicit call to staticmethod(f)

Stmt

A statement

StmtList

A list of statements

StmtListParent

The parent of a StmtList. Internal implementation class

StmtListParent_

INTERNAL: See the class StmtListParent for further information.

StmtList_

INTERNAL: See the class StmtList for further information.

Stmt_

INTERNAL: See the class Stmt for further information.

Store

The store context, the context of var in var = 0

Store_

INTERNAL: See the class Store for further information.

StrListParent

The parent of a StrList. Internal implementation class

StrListParent_

INTERNAL: See the class StrListParent for further information.

StrParent_

INTERNAL: See the class StrParent for further information.

Str_

INTERNAL: See the class Str for further information.

StringList

A list of strings (the primitive type string not Bytes or Unicode)

StringList_

INTERNAL: See the class StringList for further information.

StringLiteral

A string constant.

StringObject

A string object (unicode or bytes). Includes those occurring in the source as a literal or in a builtin module as a value.

StringPart

A part of a string literal formed by implicit concatenation. For example the string literal “abc” expressed in the source as "a" "b" "c" would be composed of three StringParts.

StringPartList
StringPartList_

INTERNAL: See the class StringPartList for further information.

StringPart_

INTERNAL: See the class StringPart for further information.

StringValue

A class representing strings, either present in the source as a literal, or in a builtin as a value.

Sub

A subtract (-) binary operator

Sub_

INTERNAL: See the class Sub for further information.

Subscript

A subscript expression, such as value[slice]

SubscriptNode

A control flow node corresponding to a subscript expression, such as value[slice]

Subscript_

INTERNAL: See the class Subscript for further information.

SuperBoundMethod
SyntaxError

A syntax error. Note that if there is a syntax error in a module, much information about that module will be lost

TemplateDottedNotation_

INTERNAL: See the class TemplateDottedNotation for further information.

TemplateWrite

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

TemplateWrite_

INTERNAL: See the class TemplateWrite for further information.

True

The boolean named constant True

Try

A try statement

Try_

INTERNAL: See the class Try for further information.

Tuple

A tuple expression such as ( 1, 3, 5, 7, 9 )

TupleNode

A control flow node corresponding to a tuple expression such as ( 1, 3, 5, 7, 9 )

TupleObject
TupleValue

A class representing tuple objects

Tuple_

INTERNAL: See the class Tuple for further information.

TypeAlias

A type alias statement, such as type T[T1,T2] = T3.

TypeAlias_

INTERNAL: See the class TypeAlias for further information.

TypeHintComment

A type-hint comment. Any comment that starts with # type:

TypeParameter

A generic type parameter, as seen in function, class, and type alias definitions.

TypeParameterList

A list of type parameters

TypeParameterListParent

A parent of a TypeParameterList. Internal implementation class.

TypeParameterListParent_

INTERNAL: See the class TypeParameterListParent for further information.

TypeParameterList_

INTERNAL: See the class TypeParameterList for further information.

TypeParameter_

INTERNAL: See the class TypeParameter for further information.

TypeVar

A type variable, with an optional bound, such as T1 and T2 in type T[T1, T2: T3] = T4.

TypeVarTuple

A type var tuple parameter, such as *T1 in type T[*T1] = T2.

TypeVarTuple_

INTERNAL: See the class TypeVarTuple for further information.

TypeVar_

INTERNAL: See the class TypeVar for further information.

UAdd

A positive (+) unary operator

UAdd_

INTERNAL: See the class UAdd for further information.

USub

A negation (-) unary operator

USub_

INTERNAL: See the class USub for further information.

UnaryExpr

A unary expression: (+x), (-x) or (~x)

UnaryExprNode

A control flow node corresponding to a unary expression: (+x), (-x) or (~x)

UnaryExpr_

INTERNAL: See the class UnaryExpr for further information.

Unaryop

A unary operator: +, -, ~ or not

Unaryop_

INTERNAL: See the class Unaryop for further information.

Unicode

A unicode string expression, such as u"\u20ac". Note that unadorned string constants such as “hello” are treated as Bytes for Python2, but Unicode for Python3.

Unit

The trivial type with a single element.

Value

A value in the Python program. Each Value is a static approximation to a set of one or more real objects.

Variable

A variable, either a global or local variable (including parameters)

VariableParent_

INTERNAL: See the class VariableParent for further information.

Version

A Version of the Python interpreter. Currently only 2.7 or 3.x but may include different sets of versions in the future.

While

A while statement, such as while parrot_resting():

While_

INTERNAL: See the class While for further information.

With

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

WithDefinition

A definition of a variable in a with statement

With_

INTERNAL: See the class With for further information.

Yield

A yield expression, such as yield value

YieldFrom

A yield expression, such as yield from value

YieldFrom_

INTERNAL: See the class YieldFrom for further information.

Yield_

INTERNAL: See the class Yield for further information.

Modules

BaseFlow
ClassValue
Module
ModuleObject

Utility module for predicates relevant to the ModuleObject class.

Object
SsaSource
TupleObject
Value

Aliases

ClassScope

The scope of a class. This is the scope of all the statements within the class definition

Context

A points-to context. Context can be one of: * “main”: Used for scripts. * “import”: Use for non-script modules. * “default”: Use for functions and methods without caller context. * All other contexts are call contexts and consist of a pair of call-site and caller context.

FunctionScope

An alias for Function used for scopes

ModuleScope

A module. This is the top level element in an AST, corresponding to a source file. It is also a Scope; the scope of global variables.

ObjectSource

An object.

Str

DEPRECATED. Use StringLiteral instead.

StrConst

DEPRECATED. Use StringLiteral instead.