Fixit icon indicating copy to clipboard operation
Fixit copied to clipboard

Replace `Optional[T]` and `Union[T, None]` with `T | None`

Open yangdanny97 opened this issue 1 year ago • 0 comments

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

yangdanny97 avatar Nov 18 '24 21:11 yangdanny97