Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pylint
/
checkers
/
__pycache__
[ HOME ]
Exec
Submit
modified_iterating_checker.cpython-311.pyc
� � h� � � � d dl mZ d dlmZ d dlmZ d dlmZmZ d dl m Z erd dlmZ ddhZ d dhZ G d � dej � � Zdd�ZdS )� )�annotations)� TYPE_CHECKING)�nodes)�checkers� interfaces)�utils)�PyLinter�append�remove�addc �� � e Zd ZdZdZdddd�ZdZ ej dd d � � d#d�� � Z d$d�Z d%d�Zed&d�� � Z ed'd�� � Zed&d�� � Zd(d�Zd(d�Zd(d�Zd)d!�Zd"S )*�ModifiedIterationCheckerz�Checks for modified iterators in for loops iterations. Currently supports `for` loops for Sets, Dictionaries and Lists. �modified_iteration)zkIterated list '%s' is being modified inside for loop body, consider iterating through a copy of it instead.�modified-iterating-listz�Emitted when items are added or removed to a list being iterated through. Doing so can result in unexpected behaviour, that is why it is preferred to use a copy of the list.)z`Iterated dict '%s' is being modified inside for loop body, iterate through a copy of it instead.�modified-iterating-dictziEmitted when items are added or removed to a dict being iterated through. Doing so raises a RuntimeError.)z_Iterated set '%s' is being modified inside for loop body, iterate through a copy of it instead.�modified-iterating-setzhEmitted when items are added or removed to a set being iterated through. Doing so raises a RuntimeError.)�W4701�E4702�E4703� r r r �node� nodes.For�return�Nonec �T � |j }|j D ]}| � ||� � �d S �N)�iter�body�._modified_iterating_check_on_node_and_children)�selfr �iter_obj� body_nodes �{/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib/python3.11/site-packages/pylint/checkers/modified_iterating_checker.py� visit_forz"ModifiedIterationChecker.visit_for6 sC � � �9���� U� U�I��?�?� �8�T�T�T�T� U� U� r"