Skip to content

[CodeStyle][task 22] enable Ruff C417 rule in python/paddle/base - #57634

Merged
luotao1 merged 3 commits into
PaddlePaddle:developfrom
zade23:Ruff_C417
Sep 25, 2023
Merged

luotao1 merged 3 commits into
PaddlePaddle:developfrom
zade23:Ruff_C417

Conversation

@zade23

@zade23 zade23 commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

PR types

Others

PR changes

Others

Description

之前的提交 #57611 在检查处理CI提示的冲突之后,不小心删了,所以重新提交一遍0.o

enable Ruff C417 rule in python/paddle/base

Index orgin fixed
~\Paddle\python\paddle\static\nn\control_flow.py out_shape = list(map(lambda a, b: a if a == b else -1, first_shape, second_shape)) out_shape = [a if a == b else -1 for a, b in zip(first_shape, second_shape)]
~\Paddle\test\legacy_test\test_lstm_cudnn_op.py tuple(map(lambda x, y: np.where(mask, x, y), new, old)) tuple(np.where(mask, x, y) for x, y in zip(new, old))
~\Paddle\test\rnn\rnn_numpy.py tuple(map(lambda x, y: np.where(mask, x, y), new, old)) tuple(np.where(mask, x, y) for x, y in zip(new, old))
~\Paddle\python\paddle\base\backward.py list(map(lambda arg: arg.decode() if isinstance(arg, bytes) else arg,args,)) [arg.decode() if isinstance(arg, bytes) else arg for arg in args]

ref:

@gouzil

gouzil commented Sep 22, 2023

Copy link
Copy Markdown
Collaborator

LGTM, @SigureMo

@paddle-bot paddle-bot Bot added the contributor External developers label Sep 22, 2023

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 25, 2023
@luotao1
luotao1 merged commit c0e5e95 into PaddlePaddle:develop Sep 25, 2023
@zade23
zade23 deleted the Ruff_C417 branch September 25, 2023 02:48
Frida-a pushed a commit to Frida-a/Paddle that referenced this pull request Oct 14, 2023
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 16, 2023
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants