Hacked By AnonymousFox
�
�܋fR � � � d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z m
Z
mZ d dlm
Z
erd dlmZ G d� d e� � Zdd�ZdS )� )�annotations)�
TYPE_CHECKING)�nodes)�BaseChecker)�DUNDER_METHODS�DUNDER_PROPERTIES�EXTRA_DUNDER_METHODS)�HIGH)�PyLinterc �F � e Zd ZdZdZdZddiZdg ddd d
�ffZdd
�Zdd�Z dS )�
DunderCheckerz!Checks related to dunder methods.�dunder����W3201)z(Bad or misspelled dunder method name %s.�bad-dunder-nameznUsed when a dunder method is misspelled or defined with a name not within the predefined list of dunder names.zgood-dunder-names�csvz<comma-separated names>z2Good dunder names which should always be accepted.)�default�type�metavar�help�return�Nonec � � t t z | j j j z | _ t
j � � D ]S\ }}|| j j j k r9| j � t |� � � � � � � �Td S �N)r r �linter�config�good_dunder_names�_dunder_methodsr �items�
py_version�extend�list�keys)�self�
since_vers�dunder_methodss �i/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/dunder.py�openzDunderChecker.open, s� � � ��
��k� �2�
3�
��
+9�*>�*@�*@� I� I�&�J���T�[�/�:�:�:��$�+�+�D��1D�1D�1F�1F�,G�,G�H�H�H�� I� I� �node�nodes.FunctionDefc � � |� � � sdS |j � d� � rM|j � d� � r5|j | j vr)| � d||j t �� � dS dS dS dS )zoCheck if known dunder method is misspelled or dunder name is not one
of the pre-defined names.
N�_r )r* �args�
confidence)� is_method�name�
startswith�endswithr �add_messager
)r$ r* s r'