Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pylint/checkers/refactoring/__pycache__/recommendation_checker.cpython-39.pyc
Ðазад
a n�h[J � @ s^ d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z G dd� dej�ZdS ) � )�annotationsN)�nodes)�checkers)�utils)�HIGH� INFERENCEc @ s& e Zd ZdZddddddd�Zd d �dd�Zed ddd�dd��Ze� dd�dd d�dd��Z dd d�dd�Zdd d�dd�Ze� ddd�d d d�d!d"��Z d d d�d#d$�Zd d d�d%d&�Ze� dd�d'd d�d(d)��Zd'd d�d*d+�Zd,d d�d-d.�Ze� d/�d0d d�d1d2��Zd0d d�d3d4�Zd5S )6�RecommendationCheckerZrefactoring)z@Consider using enumerate instead of iterating with range and len�consider-using-enumeratez~Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.)zEConsider iterating the dictionary directly instead of calling .keys()�consider-iterating-dictionarya Emitted when the keys of a dictionary are iterated through the ``.keys()`` method or when ``.keys()`` is used for a membership check. It is enough to iterate through the dictionary itself, ``for key in dictionary``. For membership checks, ``if key in dictionary`` is faster.)z Consider iterating with .items()�consider-using-dict-itemsz�Emitted when iterating over the keys of a dictionary and accessing the value by index lookup. Both the key and value can be accessed by iterating using the .items() method of the dictionary instead.)zUse %s instead�use-maxsplit-argz�Emitted when accessing only the first or last element of str.split(). The first and last element can be accessed by using str.split(sep, maxsplit=1)[0] or str.rsplit(sep, maxsplit=1)[-1] instead.)z.Use a sequence type when iterating over values�use-sequence-for-iterationzvWhen iterating over values, sequence types (e.g., ``lists``, ``tuples``, ``ranges``) are more efficient than ``sets``.)z6Formatting a regular string which could be an f-string�consider-using-f-stringz�Used when we detect a string that is being formatted with format() or % which could potentially be an f-string. The use of f-strings is preferred. Requires Python 3.6 and ``py-version >= 3.6``.)ZC0200ZC0201ZC0206ZC0207ZC0208ZC0209�None)�returnc C s | j jj}|dk| _d S )N)� � )Zlinter�config� py_version� _py36_plus)�selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pylint/checkers/refactoring/recommendation_checker.py�openA s zRecommendationChecker.openznodes.NodeNG�str�bool)�node�functionr c C s&