Summary
Inspired by #18508
I'd like to see ruff detect (and possibly fix) redundant types in unions. Examples:
import typing
foo1: A | B | A # becomes A | B
foo2: typing.Union[int, B, float, int, C] # becomes Union[int, B, float, C]
foo3: typing.Optional[None] # becomes None
For simplicity, I'd be fine leaving out nested annotations in the first iteration. They could still be added at a later time. E.g.,
import typing
foo: typing.Union[int, None, typing.Optional[int]] # could become typing.Union[int, None]