Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/extensions/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/extensions/__pycache__/comparetozero.cpython-311.pyc

�

�܋f`���dZddlmZddlZddlmZddlZddlmZddlm	Z	ddl
mZddlm
Z
erdd	lmZdd�ZGd�de	j��Zdd�ZdS)zLooks for comparisons to zero.�)�annotationsN)�
TYPE_CHECKING)�nodes)�checkers)�utils)�HIGH)�PyLinter�node�str | nodes.NodeNG�return�boolc�^�t|tj��o|jdko|jduS)NrF)�
isinstance�astroid�Const�value)r
s �p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/comparetozero.py�_is_constant_zerors0��	�4���'�'�W�D�J�!�O�W��
�RW�@W��c�V�eZdZdZdZddiZdZejd��dd
���Z	dS)
�CompareToZeroCheckerz�Checks for comparisons to zero.

    Most of the time you should use the fact that integers with a value of 0 are false.
    An exception to this rule is when 0 is allowed in the program and has a
    different meaning than None!
    �compare-to-zero�C2001)z-"%s" can be simplified to "%s" as 0 is falseyrz4Used when Pylint detects comparison to a 0 constant.�r
�
nodes.Comparer�Nonec��gd�}d|jfg}|�|j��t|��}t	tj|���}tt|��dz
��D]�}||}||dz}||dz}	d}
t|��r	||vrd}
|	}n||vrt|	��rd}
|}|
r}|�
���d|�d|	�
����}|dvr|�
��nd	|�
����}
|�d
||
f|t�����dS)N)�!=z==�is not�is���FT� >rrznot r)�argsr
�
confidence)
�left�extend�ops�iter�list�	itertools�chain�range�lenr�	as_string�add_messager)�selfr
�
_operatorsr)�iter_ops�all_ops�ops_idx�op_1�op_2�op_3�error_detected�op�original�
suggestions              r�
visit_comparez"CompareToZeroChecker.visit_compare3s���2�1�1�
�
13�D�I��.?���
�
�4�8������9�9���y���1�2�2���S��\�\�A�-�.�.�	�	�G��7�#�D��7�Q�;�'�D��7�Q�;�'�D�"�N�!��&�&�
�4�:�+=�+=�!%�������#�#�(9�$�(?�(?�#�!%�����
�"�n�n�.�.�J�J��J�J����8H�8H�J�J���/�/�/��L�L�N�N�N�0������0�0��
� � �%�"�J�/��#�	!�����-	�	rN)r
rrr)
�__name__�
__module__�__qualname__�__doc__�name�msgs�optionsr�only_required_for_messagesr>rrrrrsh���������D��
��D��G�%�U�%�&7�8�8�'�'�'�9�8�'�'�'rr�linterr	rc�J�|�t|����dS)N)�register_checkerr)rGs r�registerrJ^s%��
���0��8�8�9�9�9�9�9r)r
rrr
)rGr	rr)rB�
__future__rr,�typingrrr�pylintr�pylint.checkersr�pylint.interfacesr�pylint.lintr	r�BaseCheckerrrJrrr�<module>rRs��
%�$�"�"�"�"�"�"����� � � � � � �����������������!�!�!�!�!�!�"�"�"�"�"�"��%�$�$�$�$�$�$�����<�<�<�<�<�8�/�<�<�<�~:�:�:�:�:�:r

Hacked By AnonymousFox1.0, Coded By AnonymousFox