Module python

Import path

import python

Predicates

attribute_assigned_in_method
baseless_is_new_style
bitwise_expression_node

Holds if bit is a binary expression node with a bitwise operator. Helper for this_binary_expr_points_to.

builtin_name_points_to
builtin_object

DEPRECATED – Use Object::builtin(name) instead.

class_declares_attribute

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

collectionsAbcClass
contains_interesting_expression_within_test

Hold if outer contains inner, both are contained within a test and inner is a use is a plain use or an attribute lookup

function_can_never_return

Holds if it can be determined from the control flow graph alone that this function can never return

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.

is_collection

Retained for backwards compatibility use ClassObject.isCollection() instead.

is_context_manager

Retained for backwards compatibility use ClassObject.isContextManager() instead.

is_iterable

Retained for backwards compatibility use ClassObject.isIterable() instead.

is_iterator

Retained for backwards compatibility use ClassObject.isIterator() instead.

is_mapping

Retained for backwards compatibility use ClassObject.isMapping() instead.

is_sequence

Retained for backwards compatibility use ClassObject.isSequence() instead.

kwargs_points_to

The kwargs parameter (**kwargs) in a function definition is always a dict

live_import_from_dot_in_init

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

major_version

the Python major version number

micro_version

the Python micro version number

minor_version

the Python minor version number

moduleNameFromFile
nested_sequence_assign
non_coupling_method
object_for_string

Primarily for internal use.

potential_builtin_points_to

Gets the value, cls, origin that f would refer to if it has not been assigned some other value

quitterObject

DEPRECATED – Use Object::quitter(name) instead.

refinement_test

Holds if test is a test (a branch), use is within that test and def is an edge from that test with sense

safe_return_node

Gets a return value CFG node, provided that is safe to track across returns

scope_raises

INTERNAL – Use FunctionObject.getARaisedType() instead

scope_raises_objectapi

INTERNAL – Use FunctionObject.getARaisedType() instead

scope_raises_unknown

INTERNAL – Use FunctionObject.raisesUnknownType() instead

simple_points_to

Points-to for syntactic elements where context is not relevant

simple_types

Gets the class of the object for simple cases, namely constants, functions, comprehensions and built-in objects.

test_contains

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

theAbcMetaClassObject
theApplyFunction

DEPRECATED – Use Object::builtin("apply") instead.

theAttributeErrorType

The builtin class ‘AttributeError’

theBaseExceptionType

The builtin class ‘BaseException’

theBoolType

The built-in class ‘bool’

theBoundMethodType

The builtin class of bound methods

theBuiltinFunctionType

The class of builtin-functions

theBuiltinModuleObject

The builtin module

theBuiltinPropertyType

The class of builtin properties

theBytesType

The builtin class for bytes. str in Python2, bytes in Python3

theClassMethodType

The builtin class ‘classmethod’

theClassType

The builtin object ClassType (for old-style classes)

theComplexType

The builtin class ‘complex’

theDictType

The builtin class ‘dict’

theEmptyTupleObject

DEPRECATED – Use TupleObject::empty() instead.

theExceptionType

The builtin class ‘Exception’

theExitFunctionObject

DEPRECATED – Use Object::builtin("sysExit() instead.

theFalseObject

The built-in object False

theFloatType

The builtin class ‘float’

theFormatFunction

DEPRECATED – Use Object::builtin("format") instead.

theGeneratorType

The class of generators

theGetSetDescriptorType

The builtin class of builtin properties

theGlobalsFunction

DEPRECATED – Use Object::builtin("globals")() instead.

theHasattrFunction

DEPRECATED – Use Object::builtin("hasattr") instead.

theIOErrorType

The builtin class ‘IOError’

theIndexErrorType

The IndexError class

theInputFunction

DEPRECATED – Use Object::builtin("input") instead.

theInstanceType

The builtin object InstanceType (for old-style classes)

theIntType

The builtin class ‘int’

theKeyErrorType

The builtin class ‘KeyError’

theLenFunction

DEPRECATED – Use Object::builtin("len") instead.

theListType

The builtin class ‘list’

theLocalsFunction

DEPRECATED – Use Object::builtin("locals") instead.

theLongType

The builtin class ‘long’ (Python 2 only)

theLookupErrorType

The LookupError class

theMethodDescriptorType

The method descriptor class

theModuleType

The class of modules

theNameErrorType

The NameError class

theNoneObject

The built-in object None

theNoneType

The built-in class NoneType

theNotImplementedErrorType

The builtin class ‘NotImplementedError’

theNotImplementedObject

DEPRECATED – Use Object::notImplemented() instead.

theObjectType

The builtin class ‘object’

theOpenFunction

DEPRECATED – Use Object::builtin("open") instead.

thePrintFunction

DEPRECATED – Use Object::builtin("print") instead.

thePropertyType

The builtin class ‘property’

thePyFunctionType

The class of Python functions

theRangeType

The builtin class ‘(x)range’

theSetType

The builtin class ‘set’

theStandardErrorType

The StandardError class

theStaticMethodType

The builtin class ‘staticmethod’

theStopIterationType

The builtin class ‘StopIteration’

theStrType

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

theSuperType

The builtin class ‘super’

theSysModuleObject

The sys module

theTrueObject

The built-in object True

theTupleType

The builtin class ‘tuple’

theTypeErrorType

The builtin class ‘TypeError’

theTypeNewMethod
theTypeType

The builtin class ‘type’

theUnicodeType

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

varargs_points_to

The varargs (*varargs) in a function definition is always a tuple

version_tuple_compare

Compares the given tuple object to both the maximum and minimum possible sys.version_info values

version_tuple_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

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

AstNode

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

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

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

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

Class representing bound-methods, 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

Class representing builtin functions, such as len or print

BuiltinMethodObject
BuiltinMethodValue

Class representing builtin methods, 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

Class representing callables 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

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

Class representing classes in the Python program, both Python and built-in.

Class_

INTERNAL: See the class Class for further information.

Cmpop

A comparison operator

CmpopList

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

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

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

Deletion of an attribute del obj.attr.

EssaDefinition

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

ControlFlowNode for an ‘except’ statement.

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

Capture of a raised exception except ExceptionType ex:

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

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

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

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

This class represents a static approximation to the dynamic call-graph. A FunctionInvocation represents all calls made to a function for a given context.

FunctionLocalVariable
FunctionMetrics

The metrics for a function

FunctionObject

A function object, whether written in Python or builtin

FunctionParent

Internal implementation class

FunctionParent_

INTERNAL: See the class FunctionParent for further information.

FunctionValue

Class representing functions 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.

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

Immutable literal expressions (except tuples). Consists of string (both unicode and byte) literals and numeric literals.

ImplicitSubModuleDefinition

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

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.

IterationDefinition

DEPRECATED. For backwards compatibility only. A definition of a variable in a for loop for v in ...:

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

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.

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

Class representing modules 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

None

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

Numeric objects (ints and floats). 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

Instances of this class represent objects in the Python program. However, since the QL database is static and Python programs are dynamic, there are necessarily a number of approximations.

Operator

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

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

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.

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

Python specific sub-class of generic EssaEdgeRefinement

PyFunctionObject
PythonFunctionValue

Class representing Python functions

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

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

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

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

Sequence objects (lists and tuples) 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
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 correspoinding 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

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

Store context, the context of var in var = 0

Store_

INTERNAL: See the class Store for further information.

StrConst

A string constant.

StrListParent

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.

StringObject

String objects (unicode or bytes). Includes those occurring in the source as a literal or in a builtin module as a value.

StringPart

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.

TypeHintComment

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

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.

Value

Class representing values 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.

XMLAttribute

An attribute that occurs inside an XML element.

XMLCharacters

A sequence of characters that occurs between opening and closing tags of an XML element, excluding other elements.

XMLComment

A comment in an XML file.

XMLDTD

An XML document type definition (DTD).

XMLElement

An XML element in an XML file.

XMLFile

An XML file.

XMLLocatable

An XML element that has a location.

XMLNamespace

A namespace used in an XML file.

XMLParent

An XMLParent is either an XMLElement or an XMLFile, both of which can contain other elements.

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
BasePointsTo
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

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

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

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

Instances of this class represent objects in the Python program. However, since the QL database is static and Python programs are dynamic, there are necessarily a number of approximations.

PyNodeDefinition

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

PyNodeRefinement

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