Skip to content

[Typing][PEP585 Upgrade][2-3] Use standard collections for type hints in paddle/fluid/operators/generator/* - #66968

Merged
luotao1 merged 2 commits into
PaddlePaddle:developfrom
enkilee:pep585-2
Aug 5, 2024
Merged

luotao1 merged 2 commits into
PaddlePaddle:developfrom
enkilee:pep585-2

Conversation

@enkilee

@enkilee enkilee commented Aug 2, 2024 •

Copy link
Copy Markdown
Collaborator

PR Category

User Experience

PR Types

Devs

Description

为如下文件添加 PEP 563,并进行 PEP 585 升级:

  • paddle/fluid/operators/generator/filters.py
  • paddle/fluid/operators/generator/parse_utils.py

Related links

@paddle-bot

paddle-bot Bot commented Aug 2, 2024

Copy link
Copy Markdown

你的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 previously approved these changes Aug 2, 2024
Comment on lines +20 to +21
if TYPE_CHECKING:
from collections.abc import Sequence

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.

不要插在 import 中间,这会影响 isort,要放在 import 区域之后

你这样会使得 import 分成三部分,这不是我们所预期的

# import section1, sorted

# if type checking
    # import section3, sorted

# import section2, sorted

预期的是:

# import section1, sorted

# if type checking
    # import section2, sorted

因此 if TYPE_CHECKING 统一放在其他 import 之后

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

收到,谢谢大佬

@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 merged commit 75b4b78 into PaddlePaddle:develop Aug 5, 2024
@SigureMo SigureMo changed the title [Typing][PEP585 Upgrade][2-3] Use stardand collections for type hints in paddle/fluid/operators/generator/* [Typing][PEP585 Upgrade][2-3] Use standard collections for type hints in paddle/fluid/operators/generator/* Aug 6, 2024
@enkilee
enkilee deleted the pep585-2 branch January 8, 2025 08:15
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