PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pylint
/
extensions
/
__pycache__
/
Editing: consider_refactoring_into_while_condition.cpython-311.pyc
� � h� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ erddl mZ G d � d ej � � Zdd�ZdS )zELooks for try/except statements with too much code in the try clause.� )�annotations)� TYPE_CHECKING)�nodes)�checkers)�utils)�HIGH)�PyLinterc �Z � e Zd ZdZdZddiZ ej d� � d d �� � Zd d�Z dS )�)ConsiderRefactorIntoWhileConditionCheckera1 Checks for instances where while loops are implemented with a constant condition which. always evaluates to truthy and the first statement(s) is/are if statements which, when evaluated. to True, breaks out of the loop. The if statement(s) can be refactored into the while loop. �consider_refactoring_into_while�R3501)zGConsider using 'while %s' instead of 'while %s:' an 'if', and a 'break'�)consider-refactoring-into-while-conditionz�Emitted when `while True:` loop is used and the first statement is a break condition. The ``if / break`` construct can be removed if the check is inverted and moved to the ``while`` statement.r �node�nodes.While�return�Nonec �0 � | � |� � d S �N)� _check_breaking_after_while_true)�selfr s ��/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/pylint/extensions/consider_refactoring_into_while_condition.py�visit_whilez5ConsiderRefactorIntoWhileConditionChecker.visit_while, s � ��-�-�d�3�3�3�3�3� c � � t |j t j � � r|j � � � sdS g }|j D ]3}t |t j � � s n|� |� � �4g }d}|D ]�}|s%t |j d t j � � s n}|� |� � |j }|r^|d }t |t j � � sd}n|� |� � t |t j � � sn |j }|�^��d� |D � � }d� d� |D � � � � } t |� � dk rt j |d j � � } | sdS | � d ||j | |j � � � ft"