CodeQL library for Python
Search

Module Value

Import path

import python

Predicates

forBool

Gets the Value for the bool constant b.

forBytes

Gets the Value for the bytes constant bytes, if it exists. There will be no Value for most byte strings, unless it is explicitly declared in the source program.

forInt

Gets the NumericValue for the integer constant i, if it exists. There will be no NumericValue for most integers, but the following are guaranteed to exist: * From zero to 511 inclusive. * All powers of 2 (up to 2**30) * Any integer explicitly mentioned in the source program.

forString

Gets a Value for the string text. May be a bytes or unicode string for Python 2. There will be no Value for most strings, unless it is explicitly declared in the source program.

forUnicode

Gets the Value for the unicode constant text, if it exists. There will be no Value for most text strings, unless it is explicitly declared in the source program.

named

Gets the Value named name. If there is at least one ‘.’ in name, then the part of the name to the left of the rightmost ‘.’ is interpreted as a module name and the part after the rightmost ‘.’ as an attribute of that module. For example, Value::named("os.path.join") is the Value representing the join function of the os.path module. If there is no ‘.’ in name, then the Value returned is the builtin object of that name. For example Value::named("len") is the Value representing the len built-in function.

none_

Gets the Value for None.

siteQuitter

Shorcuts added by the site module to exit your interactive session.