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

Class PointsToContext

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.

Import path

import semmle.python.pointsto.PointsToContext

Direct supertypes

Predicates

appliesTo

Holds if this context can apply to the CFG node n.

appliesToScope

Holds if this context is relevant to the given scope.

fromCall

Holds if call is the call-site from which this context was entered and outer is the caller’s context.

fromCall

Holds if call is the call-site from which this context was entered and caller is the caller’s context.

fromRuntime

Holds if this context or one of its caller contexts is the default context.

getAVersion

Gets a version of Python that this context includes

getCall
getCost
getDepth

Gets the depth (number of calls) for this context.

getOuter

Gets the caller context for this callee context.

getRootCall
isCall

Holds if this context is a call context.

isImport

Holds if this is the “import” context.

isMain

Holds if this is the “main” context.

isRuntime

Holds if this is the “default” context.

toString

Gets a textual representation of this element.

untrackableCall

Holds if a call would be too expensive to create a new context for