§
    ÷yIf:	  ã                  ó–   — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 erddl
mZ ddd	d
dœZ ed¦  «        Z G d„ de¦  «        Zdd„ZdS )zjChecks for yoda comparisons (variable before constant)
See https://en.wikipedia.org/wiki/Yoda_conditions.
é    )Úannotations)ÚTYPE_CHECKING)Únodes)ÚBaseCheckerÚutils)ÚPyLinterú>ú>=ú<ú<=)r   r   r	   r
   )z==z!=r   r	   r   r
   c                  ól   — e Zd ZdZdZddddddgifiZd	Zdd„Z ej	        d¦  «        dd„¦   «         Z
dS )Ú"MisplacedComparisonConstantCheckerz1Checks the placement of constants in comparisons.zcomparison-placementÚC2201zComparison should be %súmisplaced-comparison-constantz˜Used 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.CompareÚleftúnodes.NodeNGÚrightÚoperatorÚstrÚreturnÚNonec                óè   — t          |t          j        ¦  «        rd S t                               ||¦  «        }|                     ¦   «         › d|› d|j        ›�}|                      d||f¬¦  «         d S )Nú r   )r   Úargs)Ú
isinstancer   ÚConstÚREVERSED_COMPSÚgetÚ	as_stringÚvalueÚadd_message)Úselfr   r   r   r   Ú
suggestions         úZ/var/www/piapp/venv/lib/python3.11/site-packages/pylint/extensions/comparison_placement.pyÚ_check_misplaced_constantz<MisplacedComparisonConstantChecker._check_misplaced_constant*   s}   € õ �e�Uœ[Ñ)Ô)ð 	ØˆFÝ!×%Ò% h°Ñ9Ô9ˆØŸšÑ)Ô)ÐEÐE¨HÐEÐE°t´zÐEÐEˆ
Ø×ÒÐ8¸tÈ:È-ÐÑXÔXÐXÐXÐXó    c                óæ   — t          |j        ¦  «        dk    rd S |j        }|j        d         \  }}|t          v r4t	          |t
          j        ¦  «        r|                      ||||¦  «         d S d S d S )Né   r   )ÚlenÚopsr   ÚCOMPARISON_OPERATORSr    r   r!   r*   )r'   r   r   r   r   s        r)   Úvisit_comparez0MisplacedComparisonConstantChecker.visit_compare7   s}   € õ ˆtŒx‰=Œ=˜AÒÐØˆFàŒyˆØœ( 1œ+‰ˆ�%ØÕ+Ð+Ð+µ
¸4ÅÄÑ0MÔ0MÐ+Ø×*Ò*¨4°°u¸hÑGÔGÐGÐGÐGð ,Ð+Ð+Ð+r+   N)
r   r   r   r   r   r   r   r   r   r   )r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚmsgsÚoptionsr*   r   Úonly_required_for_messagesr1   r   r+   r)   r   r      sŸ   € € € € € Ø;Ð;ð "€DàØ%Ø+ðAð ÐIÐJÐKð
ð	€Dð €GðYð Yð Yð Yð &€UÔ%Ð&EÑFÔFð	Hð 	Hð 	Hñ GÔFð	Hð 	Hð 	Hr+   r   Úlinterr   r   r   c                óJ   — |                       t          | ¦  «        ¦  «         d S )N)Úregister_checkerr   )r:   s    r)   Úregisterr=   D   s%   € Ø
×ÒÕ>¸vÑFÔFÑGÔGÐGÐGÐGr+   N)r:   r   r   r   )r5   Ú
__future__r   Útypingr   Úastroidr   Úpylint.checkersr   r   Úpylint.lintr   r"   Ú	frozensetr0   r   r=   r   r+   r)   ú<module>rD      sò   ðð
ð ð #Ð "Ð "Ð "Ð "Ð "à  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð à .Ð .Ð .Ð .Ð .Ð .Ð .Ð .àð %Ø$Ð$Ð$Ð$Ð$Ð$à $¨S¸Ð=Ð=€Ø �yÐ!CÑDÔDÐ ð)Hð )Hð )Hð )Hð )H¨ñ )Hô )Hð )HðXHð Hð Hð Hð Hð Hr+   