§ |<ˆj¹ ãóž—ddlmZddlmZddlmZmZddlmZddl m Z ddl m Z ddl mZddlmZerdd lmZGd „d e ¦«Zdd„ZdS)é)Ú annotations)Ú TYPE_CHECKING)ÚInstanceÚnodes)ÚUninferableBase)Ú BaseChecker)Ú safe_infer)ÚDUNDER_METHODS)ÚHIGH)ÚPyLintercóN—eZdZdZdZdZddiZdZdd „Ze dd „¦«Z dd„Z dS)Ú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.rziUsed when a dunder method is manually called instead of using the corresponding function/method/operator.©ÚreturnÚNonecó¤—i|_tj¦«D]4\}}||jjjkr|j |¦«Œ5dS©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.open0s\€Ø/1ˆÔÝ*8Ô*>Ñ*@Ô*@ð <ð <Ñ &ˆJ˜Ø˜Tœ[Ô/Ô:Ò:Ð:ØÔ$×+Ò+¨NÑ;Ô;Ð;øð <ð <óÚnodeú nodes.NodeNGÚboolcóÊ—|j}|�Yt|tj¦«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_def6su€ð”ˆØÐ å˜6¥5Ô#4Ñ5Ô5ð à”K×*Ò*¨4Ñ0Ô0ð ð”K×(Ò(¨Ñ.Ô.ð ð �tØ”]ˆFðÐ ðˆur"ú nodes.Callcód—t|jtj¦«�r |jj|jvrø| |¦«såt|jjtj¦«rCt|jjjtj ¦«r|jjjj dks€t|jj¦«}|�t|ttf¦«sdS| d||jj|j|jjft¬¦«dSdSdSdSdS)z=Check if method being called is an unnecessary dunder method.ÚsuperNr)r#ÚargsÚ confidence)r)ÚfuncrÚ AttributeÚattrnamerr.ÚexprÚCallÚNamer+r rrÚ add_messager )rr#Úinf_exprs r Ú visit_callzDunderCallChecker.visit_callDs-€õ �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)rr)r#r$rr%)r#r/rr) Ú__name__Ú __module__Ú __qualname__Ú__doc__r+ÚpriorityÚmsgsÚoptionsr!Ú staticmethodr.r<rr"r rrsˆ€€€€€ð ð ð %€DØ€Hàð ð €Dð€Gð<ð<ð<ð<ð ð ð ð ñ„\ð ððððððr"rrr rrcóJ—| t|¦«¦«dSr)Úregister_checkerr)rs r ÚregisterrG_s%€Ø ×ÒÕ-¨fÑ5Ô5Ñ6Ô6Ð6Ð6Ð6r"N)rr rr)Ú __future__rÚtypingrÚastroidrrÚ astroid.utilrÚpylint.checkersrÚpylint.checkers.utilsr Úpylint.constantsr Úpylint.interfacesr Ú pylint.lintr rrGrr"r úrQsðð #Ð"Ð"Ð"Ð"Ð"à Ð Ð Ð Ð Ð à#Ð#Ð#Ð#Ð#Ð#Ð#Ð#Ø(Ð(Ð(Ð(Ð(Ð(à'Ð'Ð'Ð'Ð'Ð'Ø,Ð,Ð,Ð,Ð,Ð,Ø+Ð+Ð+Ð+Ð+Ð+Ø"Ð"Ð"Ð"Ð"Ð"àð%Ø$Ð$Ð$Ð$Ð$Ð$ðGðGðGðGðG˜ ñGôGðGðT7ð7ð7ð7ð7ð7r"