Skip to main content

PythonComparison AST Python Object

The PythonComparison object matches a Python class definition.

The astType value for this node is comparison.

Code Pattern

This AST element captures a == b in the following code:

if a == b:
pass

Attributes

  • leftSide (type AstElement): left element of the comparison
  • operator (type AstElement): operator (like ==, <>, etc.)
  • rightSide (type AstElement): right element of the comparison