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

Module SpecialMethods

Provides support for special methods. This is done in two steps:

  • A subset of ControlFlowNodes are labelled as potentially corresponding to a special method call (by being an instance of SpecialMethod::Potential).
  • A subset of the potential special method calls are labelled as being actual special method calls (SpecialMethodCallNode) if the appropriate method is defined. Extend SpecialMethod::Potential to capture more cases.

Import path

import semmle.python.SpecialMethods

Classes

PotentialSpecialMethodCallNode

A control flow node which might correspond to a special method call.

SpecialMethodCallNode

A control flow node corresponding to a special method call.

Modules

SpecialMethod

Machinery for detecting special method calls. Extend SpecialMethod::Potential to capture more cases.