---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP045 [*] Use `X | None` for type annotations
  --> future_annotations.py:40:4
   |
40 | x: Optional[int] = None
   |    ^^^^^^^^^^^^^
41 |
42 | MyList: TypeAlias = Union[List[int], List[str]]
   |
help: Convert to `X | None`
   |
39 |
   - x: Optional[int] = None
40 + x: int | None = None
41 |
   |

UP007 [*] Use `X | Y` for type annotations
  --> future_annotations.py:42:21
   |
40 | x: Optional[int] = None
41 |
42 | MyList: TypeAlias = Union[List[int], List[str]]
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: Convert to `X | Y`
   |
41 |
   - MyList: TypeAlias = Union[List[int], List[str]]
42 + MyList: TypeAlias = List[int] | List[str]
   |
