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

Module ObjectAPI

Public API for “objects” A Value is a static approximation to a set of runtime objects.

Import path

import semmle.python.objects.ObjectAPI

Imports

Classes

BoundMethodValue

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

BuiltinFunctionValue

A builtin function, such as len or print.

BuiltinMethodValue

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

CallableValue

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

ClassValue

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

FunctionValue

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

MRO

A method-resolution-order sequence of classes

ModuleValue

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

NumericValue

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

PropertyValue

A Python property:

PythonFunctionValue

A Python function.

SequenceValue

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

StringValue

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

TupleValue

A class representing tuple objects

Value

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

Modules

Aliases

ClassScope

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

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.