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

Class Value

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

Import path

import python

Direct supertypes

Known direct subtypes

Predicates

attr

Gets a Value that represents the attribute name of this object.

getABooleanValue

Gets the boolean interpretation of this value. Could be both true and false, if we can’t determine the result more precisely.

getACall

Gets a call to this object

getACall

Gets a call to this object with the given caller context.

getAReference

Gets a ControlFlowNode that refers to this object.

getClass

Gets the class of this object. Strictly, the Value representing the class of the objects represented by this Value.

getDefiniteBooleanValue

Gets the boolean interpretation of this value, only if we can determine the result precisely. The result can be none(), but never both true and false.

getName

Gets the name of this value, if it has one. Note this is the innate name of the object, not necessarily all the names by which it can be called.

getOrigin

Gets the origin CFG node for this value.

hasAttribute

Holds if this value has the attribute name

hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

isAbsent

Whether this value is absent from the database, but has been inferred to likely exist

isBuiltin

Holds if this value is builtin. Applies to built-in functions and methods, but also integers and strings.

overrides

Whether this overrides v. In this context, “overrides” means that this object is a named attribute of a some class C and v is a named attribute of another class S, both attributes having the same name, and S is a super class of C.

toString

Gets a textual representation of this element.

Charpred