شNl d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ erddl mZ G d d e ZddZdS )z:Check for use of dictionary mutation after initialization. )annotations) TYPE_CHECKING)nodes)BaseChecker)only_required_for_messages)HIGH)PyLinterc D e Zd ZdZddiZ ed d d Zd S )DictInitMutateCheckerdict-init-mutateC3401)z>Declare all known key/values when initializing the dictionary.r zXDictionaries can be initialized with a single statement using dictionary literal syntax.nodenodes.AssignreturnNonec T t |j t j sdS |j d }t |j dk st |t j sdS | }|r2t |t j rt |j dk rdS |j d }t |t j sdS |j }t |t j sdS |j |j k r| d|t dS dS )z Detect dictionary mutation immediately after initialization. At this time, detecting nested mutation is not supported. Nr r )r confidence) isinstancevaluer Dicttargetslen AssignNamenext_siblingAssign SubscriptNamenameadd_messager )selfr dict_name first_siblingsibling_targetsibling_names t/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/extensions/dict_init_mutate.pyvisit_assignz"DictInitMutateChecker.visit_assign s! $*ej11 FLO t|!!Iu?O)P)P!F))++ mU\:: =())Q..F&.q1.%/:: F%+, 33 F ../dtLLLLL /. N)r r r r )__name__ __module____qualname__r msgsr r' r( r&