Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pylint/checkers/__pycache__/nested_min_max.cpython-39.pyc
Ðазад
a n�h� � @ s� d Z ddlmZ ddlZddlmZ ddlmZmZ ddl m Z ddlmZ ddl mZmZ dd lmZ erxdd lmZ ejejejejjfZG dd� de�Zd dd�dd�ZdS )z*Check for use of nested min/max functions.� )�annotationsN)� TYPE_CHECKING)�nodes�objects)�Context)�BaseChecker)�only_required_for_messages� safe_infer)� INFERENCE)�PyLinterc @ sp e Zd ZdZdZdZddiZeddd�d d ��Zeddd�d d��Z e d�ddd�dd��Zddd�dd�ZdS )�NestedMinMaxCheckerz�Multiple nested min/max calls on the same line will raise multiple messages. This behaviour is intended as it would slow down the checker to check for nested call with minimal benefits. )zbuiltins.minzbuiltins.maxZnested_min_maxZW3301)z@Do not use nested call of '%s'; it's possible to do '%s' instead�nested-min-maxzHNested calls ``min(1, min(2, 3))`` can be rewritten as ``min(1, 2, 3)``.znodes.NodeNG�bool)�node�returnc C s4 t |tj�sdS t|j�}t |tj�o2|�� | jv S )NF)� isinstancer �Callr �func�FunctionDefZqname� FUNC_NAMES)�clsr �inferred� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pylint/checkers/nested_min_max.py�is_min_max_call0 s �z#NestedMinMaxChecker.is_min_max_callz nodes.Callzlist[nodes.Call]c s � �fdd��j D �S )Nc s: g | ]2}� � |�r|jj�jjkrt|jj�d kr|�qS )� )r r �name�len�parent�args)�.0�arg�r r r r � <listcomp>= s �z;NestedMinMaxChecker.get_redundant_calls.<locals>.<listcomp>)r r"