[BE] Apply pep604 to torch/_functorch#175659
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/175659
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 3fed6f5 with merge base 045af41 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot label "topic: not user facing" |
|
@pytorchmergebot merge |
Merge startedYour 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 |
Since python>=3.10 is defined in the pyproject.toml, we can enable [pep604](https://peps.python.org/pep-0604/) (in python >=3.10) Why? * Fewer imports making code simpler * Standardization - prior to this change, we could have Optional or the | None intermixed in the codebase * Future proof for direction of python type system We apply this to `torch/_functorch` in this PR See pytorch#175555 for another application Pull Request resolved: pytorch#175659 Approved by: https://github.com/aorenste
Since python>=3.10 is defined in the pyproject.toml, we can enable pep604 (in python >=3.10)
Why?
We apply this to
torch/_functorchin this PRSee #175555 for another application