Replace Optional[T] and Union[T, None] with T | None - #495
Conversation
bowiechen
left a comment
There was a problem hiding this comment.
looks good! thank you for working on this.
please fix some nits and we can merge this.
Co-authored-by: Bowie Chen <543091+bowiechen@users.noreply.github.com>
Co-authored-by: Bowie Chen <543091+bowiechen@users.noreply.github.com>
| [tool.black] | ||
| target-version = ["py38"] | ||
|
|
||
| [tool.fixit] | ||
| enable = ["fixit.rules"] | ||
| python-version = "3.8" | ||
| [tool.black] | ||
| target-version = ["py310"] | ||
|
|
There was a problem hiding this comment.
you should merge these into the existing config dicts.
|
Hi @yangdanny97! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
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]withOptional[T]to replace both withT | None.Test Plan
make