Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pylint/extensions/__pycache__/magic_value.cpython-39.pyc
Ðазад
a n�h� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlm Z ddl mZmZ ddl mZ er`ddlmZ G d d � d e�Zddd �dd�ZdS )z,Checks for magic values instead of literals.� )�annotations)�match)� TYPE_CHECKING)�nodes)�BaseChecker�utils)�HIGH)�PyLinterc s� e Zd ZdZdZddiZddddd d �ffZddd �� fdd�Zdd�dd�Zdd�dd�Z ddd�dd�Z ddd�dd�Zeddd�d d!��Z e�d"�ddd�d#d$��Z� ZS )%�MagicValueCheckerz$Checks for constants in comparisons.zmagic-valueZR2004)z;Consider using a named constant or an enum instead of '%s'.�magic-value-comparisonz�Using named constants instead of magic values helps improve readability and maintainability of your code, try to avoid them in comparisons.zvalid-magic-values)r ���� � �__main__�csvz<argument names>z�List of valid magic values that `magic-value-compare` will not detect. Supports integers, floats, negative numbers, for empty string enter ``''``, for backslash values just use one backslash e.g \n.)�default�type�metavar�helpr �None��linter�returnc s t � j|d� d| _dS )zInitialize checker instance.�r � N)�super�__init__�valid_magic_vals)�selfr �� __class__r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pylint/extensions/magic_value.pyr 0 s zMagicValueChecker.__init__)r c s8 � � � r(t� fdd�� jjjD ��� _n� jjj� _d S )Nc 3 s | ]}� � |�V qd S �N)�_parse_rcfile_magic_numbers)�.0�value�r r r! � <genexpr>8 s �z)MagicValueChecker.open.<locals>.<genexpr>)�_magic_vals_ext_configured�tupler �config�valid_magic_valuesr r&