Skip to content

Conversation

@yangdanny97
Copy link
Contributor

@yangdanny97 yangdanny97 commented Nov 18, 2024

Summary

The pipe syntax for unions introduced in PEP604 is more concise than Optional, but it only works in Python 3.10+

This PR updates the rule replacing Union[T | None] with Optional[T] to replace both with T | None.

Test Plan

make

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 18, 2024
Copy link
Contributor

@bowiechen bowiechen left a comment

Choose a reason for hiding this comment

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

looks good! thank you for working on this.

please fix some nits and we can merge this.

yangdanny97 and others added 2 commits November 5, 2025 00:43
Co-authored-by: Bowie Chen <543091+bowiechen@users.noreply.github.com>
Co-authored-by: Bowie Chen <543091+bowiechen@users.noreply.github.com>
Comment on lines 76 to +84
[tool.black]
target-version = ["py38"]

[tool.fixit]
enable = ["fixit.rules"]
python-version = "3.8"
[tool.black]
target-version = ["py310"]

Copy link
Contributor

Choose a reason for hiding this comment

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

you should merge these into the existing config dicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants