Skip to content

Conversation

cyyever
Copy link
Collaborator

@cyyever cyyever commented Sep 22, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/163489

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 8d3ffb3 with merge base 281bb56 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@cyyever cyyever changed the title Replace Literal[None] with None Replace Literal[None] with None in typing Sep 22, 2025
@cyyever cyyever requested a review from Skylion007 September 22, 2025 06:52
Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
@vadimkantorov
Copy link
Contributor

vadimkantorov commented Sep 22, 2025

I also wonder what's the stance on Optional[T] -> T | None? (and List -> list, Dict -> dict, Tuple -> tuple etc). This would reduce needed number of from typing import ...

@cyyever
Copy link
Collaborator Author

cyyever commented Sep 22, 2025

@pytorchbot label "topic: not user facing"

@cyyever
Copy link
Collaborator Author

cyyever commented Sep 22, 2025

@vadimkantorov It is not a good time to change them because the build system still assumes Python 3.9.

@vadimkantorov
Copy link
Contributor

vadimkantorov commented Sep 22, 2025

oh right :( though python 3.9 EOL's in roughly one month

@cyyever
Copy link
Collaborator Author

cyyever commented Sep 22, 2025

@vadimkantorov Yes, we can start the changes one or two weeks later.

Copy link
Collaborator

@Skylion007 Skylion007 left a comment

Choose a reason for hiding this comment

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

There is a ruff rule for this, don't know if it's out of preview yet

@Skylion007
Copy link
Collaborator

I also wonder what's the stance on Optional[T] -> T | None? (and List -> list, Dict -> dict, Tuple -> tuple etc). This would reduce needed number of from typing import ...

We have a ruff rule here we need to enable, but haven't yet. We can't remove all instances in the codebase because there are some tests for backward compatibility / handling of backwards compatibility.

@Skylion007
Copy link
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 22, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@janeyx99 janeyx99 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Sep 22, 2025
@cyyever cyyever deleted the pt014 branch September 22, 2025 23:53
dsashidh pushed a commit to dsashidh/pytorch that referenced this pull request Sep 26, 2025
This PR replaces Literal[None] with None in typing.

Pull Request resolved: pytorch#163489
Approved by: https://github.com/Skylion007, https://github.com/mlazos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants