CodeQL library for Python

Class NumericObject

Numeric objects (ints and floats). Includes those occurring in the source as a literal or in a builtin module as a value.

Import path

import python

Direct supertypes

Indirect supertypes



Gets the Boolean value that this object would evaluate to in a Boolean context, such as bool(x) or if x: ...


Gets the value of this object if it is a constant float


Gets the value of this object if it is a constant integer and it fits in a QL int


Gets the string representation of this object, equivalent to calling repr() in Python

Inherited predicates


INTERNAL – Do not use

from Object

Gets an inferred type for this object, without using inter-procedural analysis. WARNING: The lack of context makes this less accurate than f.refersTo(this, result, _) for a control flow node ‘f’

from Object

Gets the point in the source code from which this object “originates”.

from Object

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.

from Object

Holds if this object can be referred to by longName For example, the modules dict in the sys module has the long name sys.modules and the name os.path.join will refer to the path joining function even though it might be declared in the posix or nt modules. Long names can have no more than three dots after the module name.

from Object

Whether this is a builtin object. A builtin object is one defined by the implementation, such as the integer 4 or by a native extension, such as a NumPy array class.

from Object

Retained for backwards compatibility. See Object.isBuiltin()

from Object
maybefrom Object
notClassfrom Object

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

from Object

Gets the class of this object for simple cases, namely constants, functions, comprehensions and built-in objects.

from Object

Gets a textual representation of this element.

from Object