LP3H d Z ddlmZ ddlZddlmZ ddlmZmZ ddl m
Z
ddlmZm
Z
ddlmZ erdd lmZ ej ej ej ej j fZ G d
de
ZddZdS )z*Check for use of nested min/max functions. )annotationsN)
TYPE_CHECKING)nodesobjects)BaseChecker)only_required_for_messages
safe_infer) INFERENCE)PyLinterc | e Zd ZdZdZdZddiZedd
Zedd
Z e
d dd ZdS )NestedMinMaxCheckerzMultiple 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.maxnested_min_maxW3301)z@Do not use nested call of '%s'; it's possible to do '%s' insteadnested-min-maxzHNested calls ``min(1, min(2, 3))`` can be rewritten as ``min(1, 2, 3)``.nodenodes.NodeNGreturnboolc t |t j sdS t |j }t |t j o| | j v S )NF)
isinstancer Callr funcFunctionDefqname
FUNC_NAMES)clsr inferreds p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/checkers/nested_min_max.pyis_min_max_callz#NestedMinMaxChecker.is_min_max_call/ sX $
++ 5di((x!233
3 CN2
nodes.Calllist[nodes.Call]c . fdj D S )Nc r g | ]3} | r|j j j j k 1|4S )r r name).0argr r s r