§ |<ˆj¹ ã óž — d dl mZ d dlmZ d dlmZmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZ erd d lmZ G d „ de ¦ « Zdd„ZdS )é )Úannotations)Ú TYPE_CHECKING)ÚInstanceÚnodes)ÚUninferableBase)ÚBaseChecker)Ú safe_infer)ÚDUNDER_METHODS)ÚHIGH)ÚPyLinterc óN — e Zd ZdZdZdZddiZdZdd „Ze dd „¦ « Z dd„ZdS )ÚDunderCallCheckera‘ Check for unnecessary dunder method calls. Docs: https://docs.python.org/3/reference/datamodel.html#basic-customization We exclude names in list pylint.constants.EXTRA_DUNDER_METHODS such as __index__ (see https://github.com/PyCQA/pylint/issues/6795) since these either have no alternative method of being called or have a genuine use case for being called manually. Additionally, we exclude classes that are not instantiated since these might be used to access the dunder methods of a base class of an instance. We also exclude dunder method calls on super() since these can't be written in an alternative manner. úunnecessary-dunder-calléÿÿÿÿÚC2801)z)Unnecessarily calls dunder method %s. %s.r ziUsed when a dunder method is manually called instead of using the corresponding function/method/operator.© ÚreturnÚNonec ó¤ — i | _ t j ¦ « D ]4\ }}|| j j j k r| j |¦ « Œ5d S ©N)Ú_dunder_methodsr ÚitemsÚlinterÚconfigÚ py_versionÚupdate)ÚselfÚ since_versÚdunder_methodss úp/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/pylint/checkers/dunder_methods.pyÚopenzDunderCallChecker.open0 s\ € Ø/1ˆÔÝ*8Ô*>Ñ*@Ô*@ð <ð <Ñ&ˆJ˜Ø˜Tœ[Ô/Ô:Ò:Ð:ØÔ$×+Ò+¨NÑ;Ô;Ð;øð <ð <ó Únodeúnodes.NodeNGÚboolc óÊ — | j }|�Yt |t j ¦ « r6|j d¦ « r|j d¦ « rdS |j }|YdS )zACheck if dunder method call is within a dunder method definition.NÚ__TF)ÚparentÚ isinstancer ÚFunctionDefÚnameÚ startswithÚendswith)r# r( s r Úwithin_dunder_defz#DunderCallChecker.within_dunder_def6 su € 𠔈ØÐ å˜6¥5Ô#4Ñ5Ô5ð à”K×*Ò*¨4Ñ0Ô0ð ð ”K×(Ò(¨Ñ.Ô.ð ð �tØ”]ˆFð Ð ð ˆur" ú nodes.Callc ód — t |j t j ¦ « �r |j j | j v rø| |¦ « såt |j j t j ¦ « rCt |j j j t j ¦ « r|j j j j dk s€t |j j ¦ « }|�t |t t f¦ « sdS | d||j j | j |j j ft ¬¦ « dS dS dS dS dS )z=Check if method being called is an unnecessary dunder method.ÚsuperNr )r# ÚargsÚ confidence)r) Úfuncr Ú AttributeÚattrnamer r. ÚexprÚCallÚNamer+ r r r Úadd_messager )r r# Úinf_exprs r Ú visit_callzDunderCallChecker.visit_callD s- € õ �t”y¥%¤/Ñ2Ô2ñ à” Ô" dÔ&:Ð:Ð:Ø×*Ò*¨4Ñ0Ô0ð ;õ ˜4œ9œ>5¬:Ñ6Ô6ð ;õ ˜tœyœ~Ô2µE´JÑ?Ô?ð ;ð ”I”NÔ'Ô,°Ò7Ð7õ " $¤)¤.Ñ1Ô1ˆHàÐ ¥J¨x½(ÅOÐ9TÑ$UÔ$UÐ ð �à×ÒØ)ØØ”iÔ(¨$Ô*>¸t¼yÔ?QÔ*RÐSÝð ñ ô ð ð ð ð# ð à:Ð:Ð:Ð:ð 8Ð7r" N)r r )r# r$ r r% )r# r/ r r )Ú__name__Ú __module__Ú__qualname__Ú__doc__r+ ÚpriorityÚmsgsÚoptionsr! Ústaticmethodr. r<