§
    öyIf¾  ã                  ó¸   — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 erd dl
mZ  ed¦  «        Z ed¦  «        Z ed	¦  «        Z G d
„ de¦  «        Zdd„ZdS )é    )Úannotations)ÚTYPE_CHECKING)Únodes)ÚBaseChecker)ÚHIGH)ÚPyLinter)ú<z<=ú>z>=z!=z==)Úiszis not)Úinznot inc                  ó.   — e Zd ZdZdZddiZdd	„Zdd„ZdS )ÚBadChainedComparisonCheckerz5Checks for unintentional usage of chained comparison.úbad-chained-comparisonÚW3601)zTSuspicious %s-part chained comparison using semantically incompatible operators (%s)r   zäUsed 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]ÚreturnÚboolc                ó‚   ‡— t           t          t          fD ]}|d         |v r|ŠŒt          ˆfd„|D ¦   «         ¦  «         S )Nr   c              3  ó    •K  — | ]}|‰v V — Œ	d S ©N© )Ú.0ÚoÚgroups     €úZ/var/www/piapp/venv/lib/python3.11/site-packages/pylint/checkers/bad_chained_comparison.pyú	<genexpr>zHBadChainedComparisonChecker._has_diff_semantic_groups.<locals>.<genexpr>*   s'   øè è € Ð5Ð5 a�q˜E�zÐ5Ð5Ð5Ð5Ð5Ð5ó    )ÚCOMPARISON_OPÚIDENTITY_OPÚMEMBERSHIP_OPÚall)Úselfr   Úsemantic_groupr   s      @r   Ú_has_diff_semantic_groupsz5BadChainedComparisonChecker._has_diff_semantic_groups%   sT   ø€ å,­k½=ÐIð 	'ð 	'ˆNØ˜Œ|˜~Ð-Ð-Ø&�øÝÐ5Ð5Ð5Ð5¨9Ð5Ñ5Ô5Ñ5Ô5Ð5Ð5r   Únodeúnodes.CompareÚNonec                óB  — t          d„ |j        D ¦   «         ¦  «        }|                      |¦  «        rkt          |j        ¦  «        › }d                     d„ |d d…         D ¦   «         ¦  «        d|d         › d�z   }|                      d|||ft          ¬¦  «         d S d S )	Nc                ó   — h | ]
}|d          ’ŒS )r   r   )r   Úops     r   ú	<setcomp>z<BadChainedComparisonChecker.visit_compare.<locals>.<setcomp>-   s   € Ð5Ð5Ð5 b˜B˜qœEÐ5Ð5Ð5r   z, c              3  ó"   K  — | ]
}d |› d �V — ŒdS )ú'Nr   )r   r   s     r   r   z<BadChainedComparisonChecker.visit_compare.<locals>.<genexpr>1   s*   è è € Ð;Ð; q˜(˜a˜(˜(˜(Ð;Ð;Ð;Ð;Ð;Ð;r   éÿÿÿÿz and 'r.   r   )r&   ÚargsÚ
confidence)ÚsortedÚopsr%   ÚlenÚjoinÚadd_messager   )r#   r&   r   Ú	num_partsÚincompatibless        r   Úvisit_comparez)BadChainedComparisonChecker.visit_compare,   sË   € ÝÐ5Ð5¨D¬HÐ5Ñ5Ô5Ñ6Ô6ˆ	Ø×)Ò)¨)Ñ4Ô4ð 
	Ý˜tœx™=œ=Ð*ˆIà—	’	Ð;Ð;¨I°c°r°c¬NÐ;Ñ;Ô;Ñ;Ô;Ð>WÀyÐQSÄ}Ð>WÐ>WÐ>WÑWð ð ×ÒØ(ØØ Ð/Ýð	 ñ ô ð ð ð ð
	ð 
	r   N)r   r   r   r   )r&   r'   r   r(   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚmsgsr%   r9   r   r   r   r   r      sV   € € € € € Ø?Ð?à#€Dàð 
ð	€Dð6ð 6ð 6ð 6ðð ð ð ð ð r   r   Úlinterr   r   r(   c                óJ   — |                       t          | ¦  «        ¦  «         d S r   )Úregister_checkerr   )r@   s    r   ÚregisterrC   ;   s%   € Ø
×ÒÕ7¸Ñ?Ô?Ñ@Ô@Ð@Ð@Ð@r   N)r@   r   r   r(   )Ú
__future__r   Útypingr   Úastroidr   Úpylint.checkersr   Úpylint.interfacesr   Úpylint.lintr   Ú	frozensetr   r    r!   r   rC   r   r   r   ú<module>rK      sú   ðð
 #Ð "Ð "Ð "Ð "Ð "à  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø "Ð "Ð "Ð "Ð "Ð "àð %Ø$Ð$Ð$Ð$Ð$Ð$à�	Ð<Ñ=Ô=€ØˆiÐ(Ñ)Ô)€Ø�	Ð*Ñ+Ô+€ð"ð "ð "ð "ð " +ñ "ô "ð "ðJAð Að Að Að Að Ar   