#]mU> d Z ddlmZ ddlmZ ddlmZ ddlmZm Z erddl
mZ ddd d
dZ e
d Z G d
de ZddZdS )zjChecks for yoda comparisons (variable before constant)
See https://en.wikipedia.org/wiki/Yoda_conditions.
)annotations)
TYPE_CHECKING)nodes)BaseCheckerutils)PyLinter>>=<<=)r r r r
)z==z!=r r r r
c l e Zd ZdZdZddddddgifiZd ZddZ ej d dd Z
dS )"MisplacedComparisonConstantCheckerz1Checks the placement of constants in comparisons.zcomparison-placementC2201zComparison should be %smisplaced-comparison-constantzUsed when the constant is placed on the left side of a comparison. It is usually clearer in intent to place it in the right hand side of the comparison. old_names)C0122z!old-misplaced-comparison-constant node
nodes.Compareleftnodes.NodeNGrightoperatorstrreturnNonec t |t j rd S t || }| d| d|j }| d||f d S )N r )r args)
isinstancer ConstREVERSED_COMPSget as_stringvalueadd_message)selfr r r r
suggestions x/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/extensions/comparison_placement.py_check_misplaced_constantz