관리-도구
편집 파일: basic_error_checker.cpython-311.pyc
� �܋f�W � �� � d Z ddlmZ ddlZddlmZ ddlmZ ddlZddlm Z ddl mZ ddlm Z dd lmZ dd lmZ ddlmZ dd hZ ed� � ZdZd d�Zd!d�Zd"d�Zd#d�Z G d� de� � ZdS )$z+Basic Error checker from the basic checker.� )�annotationsN)�Iterator)�Any)�nodes)�InferenceResult)�utils)� _BasicChecker)� infer_all)�HIGHz_py_abc.ABCMetazabc.ABCMeta)� __module__ztyping.ForwardRef� break_node�nodes.Break�return�nodes.For | nodes.While | Nonec �� � t j t j f}| j }t ||� � r| t |dg � � v r/|} |j }|�n#t ||� � �| t |dg � � v �/|S )z�Returns the loop node that holds the break node in arguments. Args: break_node (astroid.Break): the break node of interest. Returns: astroid.For or astroid.While: the loop node holding the break node. �orelse)r �For�While�parent� isinstance�getattr)r � loop_nodesr s �y/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/base/basic_error_checker.py�_get_break_loop_noder s� � � �)�U�[�)�J� � �F����,�,� � �g���"�?� ?� 1� 1� � �����>�� ���,�,� � �g���"�?� ?� 1� 1� �M� �loop�nodes.For | nodes.While�boolc � � �� t j t j f}t j t j f}� fd�� � ||�� � D � � �t �fd�� � t j |�� � D � � � � S )z�Returns true if a loop may end with a break statement. Args: loop (astroid.For, astroid.While): the loop node inspected. Returns: bool: True if the loop may end with a break statement, False otherwise. c � �� g | ] }|�k �|��S � r! )�.0�_noder s �r � <listcomp>z%_loop_exits_early.<locals>.<listcomp><