X8@}u d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z erd dl
mZ ed Z
ed Z ed Z G d
de ZddZdS ) )annotations)
TYPE_CHECKING)nodes)BaseChecker)HIGH)PyLinter)z>=z!=z==)iszis not)inznot inc . e Zd ZdZdZddiZdd Zdd
ZdS )BadChainedComparisonCheckerz5Checks for unintentional usage of chained comparison.bad-chained-comparisonW3601)zTSuspicious %s-part chained comparison using semantically incompatible operators (%s)r zUsed when there is a chained comparison where one expression is part of two comparisons that belong to different semantic groups ("<" does not mean the same thing as "is", chaining them in "0 < x is None" is probably a mistake). operators list[str]returnboolc t t t fD ]}|d |v r|t fd|D S )Nr c 3 K | ]}|v V d S N ).0ogroups x/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/checkers/bad_chained_comparison.py zHBadChainedComparisonChecker._has_diff_semantic_groups..* s' 55aqEz555555 )
COMPARISON_OPIDENTITY_OP
MEMBERSHIP_OPall)selfr semantic_groupr s @r _has_diff_semantic_groupsz5BadChainedComparisonChecker._has_diff_semantic_groups% sT ,k=I ' 'N|~--&555595555555r node
nodes.CompareNonec B t d |j D }| | rkt |j }d d |d d D d|d dz }| d|||ft d S d S ) Nc h | ]
}|d S )r r )r ops r z.- s 555bBqE555r z, c 3 " K | ]
}d | d V dS )'Nr )r r s r r z.1 s* ;;q(a(((;;;;;;r z and 'r. r )r&