관리-도구
편집 파일: emptystring.cpython-311.pyc
� �܋f� � � � d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z ddl mZ ddlm Z erdd lmZ G d � de j � � Zdd�ZdS )z'Looks for comparisons to empty string.� )�annotationsN)� TYPE_CHECKING)�nodes)�checkers)�utils)�HIGH)�PyLinterc �R � e Zd ZdZddiZdZ ej d� � dd �� � Zd S )�CompareToEmptyStringChecker�compare-to-empty-string�C1901)z;"%s" can be simplified to "%s" as an empty string is falseyr z@Used when Pylint detects comparison to an empty string constant.� �node� nodes.Compare�return�Nonec �l � h d�}d|j fg}|� |j � � t |� � }t t j |� � � }t t |� � dz � � D ]�}|| }||dz }||dz }d} |�|�||vr�+d} t j |� � rd} |� � � } n*t j |� � rd} |� � � } | r=|dv rd | � �n| }| � d |� � � |f|t �� � ��dS )a Checks for comparisons to empty string. Most of the time you should use the fact that empty strings are false. An exception to this rule is when an empty string value is allowed in the program and has a different meaning than None! > �!=�is not�is�==� � � FNT> r r znot r )�argsr � confidence)�left�extend�ops�iter�list� itertools�chain�range�lenr �is_empty_str_literal� as_string�add_messager )�selfr � _operatorsr �iter_ops�ops_idx�op_1�op_2�op_3�error_detected� node_name� suggestions �n/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/emptystring.py� visit_comparez)CompareToEmptyStringChecker.visit_compare"