Skip to content

[Typing] Disallow generic without type arguments #65382

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

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Jun 22, 2024

PR Category

User Experience

PR Types

Improvements

Description

当类型提示中存在泛型时,不允许不指定泛型参数,即便指定为 Any,使用 mypy disallow_any_generics1 强制规避(这条规则的名字有点奇怪,事实上只是不允许不指定泛型参数,但泛型参数写 Any 是允许的,比如 list 会挂掉,list[Any] 是允许的,刚好满足需求)

@megemini

PCard-66972

Footnotes

  1. https://mypy.readthedocs.io/en/stable/config_file.html#confval-disallow_any_generics

@SigureMo SigureMo requested a review from gouzil as a code owner June 22, 2024 17:08
Copy link

paddle-bot bot commented Jun 22, 2024

你的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.

@gouzil gouzil requested review from zrr1999 and removed request for zrr1999 June 23, 2024 02:34
Copy link
Contributor

@megemini megemini 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 merged commit acfc48a into PaddlePaddle:develop Jun 23, 2024
@SigureMo SigureMo deleted the typing/disallow-generic-without-type-arguments branch June 23, 2024 07:37
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Jun 25, 2024
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants