bgddlmZddlmZddlmZddlmZddlm Z erddl m Z e dZ e dZe d ZGd d eZddZdS)) annotations) TYPE_CHECKING)nodes) BaseChecker)HIGH)PyLinter)z>=z!=z==)iszis not)inznot inc.eZdZdZdZddiZdd Zdd ZdS)BadChainedComparisonCheckerz5Checks for unintentional usage of chained comparison.bad-chained-comparisonW3601)zTSuspicious %s-part chained comparison using semantically incompatible operators (%s)rzUsed 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]returnboolctttfD]}|d|vr|tfd|D S)Nrc3 K|]}|vV dSN).0ogroups w/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/checkers/bad_chained_comparison.py zHBadChainedComparisonChecker._has_diff_semantic_groups..*s'55aqEz555555) COMPARISON_OP IDENTITY_OP MEMBERSHIP_OPall)selfrsemantic_grouprs @r_has_diff_semantic_groupsz5BadChainedComparisonChecker._has_diff_semantic_groups%sT,k=I ' 'N|~--&555595555555rnode nodes.CompareNonecBtd|jD}||rkt|j}dd|ddDd|ddz}|d|||ft dSdS) Nch|] }|d S)rr)rops r z.-s555bBqE555rz, c3"K|] }d|dV dS)'Nr)rrs rrz.1s*;;q(a(((;;;;;;rz and 'r.r)r&args confidence)sortedopsr%lenjoin add_messager)r#r&r num_parts incompatibless r visit_comparez)BadChainedComparisonChecker.visit_compare,s55DH55566  ) )) 4 4 tx==*I ;;IcrcN;;;;;>WyQS}>W>W>WW    (/        rN)rrrr)r&r'rr()__name__ __module__ __qualname____doc__namemsgsr%r9rrrrrsV?? #D  D6666      rrlinterrrr(cJ|t|dSr)register_checkerr)r@s rregisterrC;s% 7??@@@@@rN)r@rrr() __future__rtypingrastroidrpylint.checkersrpylint.interfacesr pylint.lintr frozensetrr r!rrCrrrrKs #""""" ''''''""""""%$$$$$$ <== i())  *++ """""+"""JAAAAAAr