관리-도구
편집 파일: set_membership.cpython-311.pyc
� �܋f � �v � d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z erd dl mZ G d� de� � Zdd �Z dS )� )�annotations)� TYPE_CHECKING)�nodes)�BaseChecker)�only_required_for_messages)�PyLinterc �^ � � e Zd ZdZddiZd� fd�Z ed � � dd�� � Zdd�Z� xZ S )�SetMembershipChecker�set_membership�R6201)z&Consider using set for membership test�use-set-for-membershipz`Membership tests are more efficient when performed on a lookup optimized datatype like ``sets``.�linterr �return�Nonec �L �� t � � � |�� � dS )zInitialize checker instance.�r N)�super�__init__)�selfr � __class__s ��q/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/set_membership.pyr zSetMembershipChecker.__init__ s$ �� � �������'�'�'�'�'� r �node� nodes.Comparec �V � |j D ] \ }}|dk r| � |� � �!d S )N�in)�ops�_check_in_comparison)r r �op� comparators r � visit_comparez"SetMembershipChecker.visit_compare! s? � �"�h� 6� 6�N�B� ��T�z�z��)�)�*�5�5�5�� 6� 6r r �nodes.NodeNGc �� � t |t j � � rt |t j � � rdS t d� |j D � � � � r| � d|�� � dS dS )zBChecks for membership comparisons with in-place container objects.Nc 3 �J K � | ]}t |t j � � V � �d S �N)� isinstancer �Const)�.0�items r � <genexpr>z<SetMembershipChecker._check_in_comparison.<locals>.<genexpr>/ s. � � � �I�I��z�$���,�,�I�I�I�I�I�Ir r )r )r&