Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][PLR1701] unify multiple isinstance expressions as one #52150

Merged
merged 4 commits into from
Mar 28, 2023

Conversation

KimBioInfoStudio
Copy link
Contributor

@KimBioInfoStudio KimBioInfoStudio commented Mar 25, 2023

PR types

Others

PR changes

Others

Describe

https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/consider-merging-isinstance.html
isinstance(a, b) or isinstance (a,c) 替换为 isinstance(a, (bc))

#51729 56
是否可以引入本 rule:✅ 可引入。
是否可引入自动修复: 无自动修复功能。

@paddle-bot
Copy link

paddle-bot bot commented Mar 25, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Mar 25, 2023
@paddle-bot
Copy link

paddle-bot bot commented Mar 25, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@SigureMo
Copy link
Member

是否可引入自动修复:❌ 可引入。

这里是什么意思啊 😂,这条 Rule 不具备自动修复功能,直接说明「无自动修复功能,需手动修复」即可

另外建议增加在说明里加上相关文档(非 Linter 自身文档,而是修改的这一语法结构、函数的相关文档)

@SigureMo
Copy link
Member

另外标题改一下吧,按照其他 PR 的样式,说明下这个 PR 做了什么

@KimBioInfoStudio KimBioInfoStudio changed the title fix PLR1701 [CodeStyle][PLR1701] repeated-isinstance-calls Mar 26, 2023
@KimBioInfoStudio
Copy link
Contributor Author

另外标题改一下吧,按照其他 PR 的样式,说明下这个 PR 做了什么

Done

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTM

@SigureMo SigureMo changed the title [CodeStyle][PLR1701] repeated-isinstance-calls [CodeStyle][PLR1701] unify multiple isinstance expressions as one Mar 26, 2023
@luotao1 luotao1 merged commit c1838da into PaddlePaddle:develop Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants