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
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_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_
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_
Alias_
And

An and boolean operator

And_
AnnAssign

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

AnnAssign_
ArgumentRefinement

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

Arguments

The arguments in a function definition

ArgumentsParent

Internal implementation class

ArgumentsParent_
Arguments_
Assert

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

Assert_
Assign

A statement that includes a binding (except imports)

AssignExpr

An assignment expression, such as x := y

AssignExpr_
AssignStmt

An assignment statement

Assign_
AssignmentDefinition

An assignment to a variable v = val

AstNode

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

AstNode_
AsyncFor
AsyncWith
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_
AugAssign

An augmented assignment statement, such as x += y

AugAssign_
AugLoad

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

AugLoad_
AugStore

Augmented store context, the context of var in var += 1

AugStore_
Await

An await expression such as await coro.

Await_
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_
BitAnd

A bitwise and (&) binary operator

BitAnd_
BitOr

A bitwise or (|) binary operator

BitOr_
BitXor

A bitwise exclusive-or (^) binary operator

BitXor_
BoolExpr

A boolean shortcut (and/or) operation

BoolExprNode

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

BoolExpr_
BoolParent_
BooleanLiteral

A boolean named constant, either True or False

Boolop

A short circuit boolean operator, and/or

Boolop_
Break

A break statement

Break_
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_
Bytes_
Call

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

CallNode

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

Call_
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_
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_
Cmpop

A comparison operator

CmpopList

List of comparison operators in a comparison

CmpopList_
Cmpop_
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_
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_
Comprehension_
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_
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_
Delete

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

Delete_
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_
DictDisplayItem
DictItem
DictItemList
DictItemListParent
DictItemListParent_
DictItemList_
DictItem_
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_
Dict_
Div

An (true) divide (/) binary operator

Div_
Ellipsis

An ellipsis expression, such as ...

Ellipsis_
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_
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_
ExceptionCapture

Capture of a raised exception except ExceptionType ex:

Exec

An exec statement

Exec_
Expr

An expression

ExprContext

A context in which an expression used

ExprContextParent

Internal implementation class

ExprContextParent_
ExprContext_
ExprList

A list of expressions

ExprListParent

Internal implementation class

ExprListParent_
ExprList_
ExprOrStmt_
ExprParent

Internal implementation class

ExprParent_
ExprStmt

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

ExprStmt_
Expr_
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_
FloatLiteral

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

FloorDiv

An floor divide (//) binary operator

FloorDiv_
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_
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_
Fstring

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

Fstring_
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_
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_
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_
GeneratorExp

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

GeneratorExp_
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_
Gt

A greater than (>) comparison operator

GtE

A greater than or equals (>=) comparison operator

GtE_
Gt_
If

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

IfExp

A conditional expression such as, body if test else orelse

IfExp_
IfExprNode

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

If_
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_
ImportMember

A from ... import ... expression

ImportMemberNode

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

ImportMember_
ImportStar

An import * statement

ImportStarNode

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

ImportStarRefinement

Possible redefinition of variable via from ... import *

ImportStar_
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_
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_
IntegerLiteral

An integer numeric constant, such as 7 or 0x9

Invert

An invert (~) unary operator

Invert_
Is

An is comparison operator

IsNot

An is not comparison operator

IsNot_
Is_
IterationDefinition

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

KeyValuePair
KeyValuePair_
Keyword

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

Keyword_
LShift

A left shift (<<) binary operator

LShift_
Lambda

A lambda expression, such as lambda x:x*x

Lambda_
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_
ListNode

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

ListObject
List_
Load

Load context, the context of var in len(var)

Load_
LocalVariable

A local (function or class) variable

Location
LocationParent_
Lt

A less than (<) comparison operator

LtE

A less than or equals (<=) comparison operator

LtE_
Lt_
MRO

A method-resolution-order sequence of classes

MatMult

A matrix multiplication (@) binary operator

MatMult_
MethodCallsiteRefinement

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

Mod

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

Mod_
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_
Mult

A multiplication (*) binary operator

Mult_
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_
NegativeIntegerLiteral
NonEmptyTupleObject
NonEscapingGlobalVariable
NonLocalVariable
None

None

Nonlocal

A nonlocal statement, such as nonlocal var

Nonlocal_
Not

A not unary operator

NotEq

A not equals (!=) comparison operator

NotEq_
NotIn

An not in comparison operator

NotIn_
Not_
Num

A numerical constant expression, such as 7 or 4.2

Num_
NumericObject

Numeric objects (ints and floats). Includes those occurring in the source as a literal or in a builtin module 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_
Or

An or boolean operator

Or_
PackageObject
Param

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

Param_
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_
Pass

A pass statement

Pass_
PhiFunction

A Phi-function as specified in classic SSA form.

PlaceHolder
PlaceHolder_
Pow

A power (**) binary operator

Pow_
Print

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

Print_
PropertyObject

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

A raise statement, such as raise CompletelyDifferentException()

RaiseStmtNode

A flow node for a raise statement

Raise_
RaisingNode

Subset of ControlFlowNodes which might raise an exception

Repr

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

Repr_
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_
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_
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_
SetNode
Set_
SingleSuccessorGuard

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

Slice

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

Slice_
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

Starred_
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_
StmtList_
Stmt_
Store

Store context, the context of var in var = 0

Store_
StrConst

A string constant.

StrListParent

Internal implementation class

StrListParent_
StrParent_
Str_
StringList

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

StringList_
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_
StringPart_
Sub

A subtract (-) binary operator

Sub_
Subscript

A subscript expression, such as value[slice]

SubscriptNode

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

Subscript_
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_
TemplateWrite

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

TemplateWrite_
True

The boolean named constant True

Try

A try statement

Try_
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_
TypeHintComment

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

UAdd

A positive (+) unary operator

UAdd_
USub

A negation (-) unary operator

USub_
UnaryExpr

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

UnaryExprNode

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

UnaryExpr_
Unaryop

A unary operator: +, -, ~ or not

Unaryop_
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_
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_
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_
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 of the form <!-- ... --> is an XML comment.

XMLDTD

A “Document Type Definition” of an XML file.

XMLElement

An XML tag 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_
Yield_

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.