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

Module Comparisons

Provides classes representing comparison operators.

Import path

import semmle.python.Comparisons

Imports

Predicates

eq

Gets the CompareOp for “equals”.

ge

Gets the CompareOp for “greater than or equal to”.

gt

Gets the CompareOp for “greater than”.

le

Gets the CompareOp for “less than or equal to”.

lt

Gets the CompareOp for “less than”.

ne

Gets the CompareOp for “not equals”.

Classes

CompareOp

A class representing the six comparison operators, ==, !=, <, <=, > and >=.

Comparison

A comparison which can be simplified to the canonical form x OP y + k where x and y are ControlFlowNodes, k is a floating point constant and OP is one of <=, >, == or !=.

ComparisonControlBlock

A basic block which terminates in a condition, splitting the subsequent control flow, in which the condition is an instance of Comparison