---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP006 [*] Use `list` instead of `List` for type annotation
  --> future_annotations.py:34:18
   |
34 | def f(x: int) -> List[int]:
   |                  ^^^^
35 |     y = List[int]()
36 |     y.append(x)
   |
help: Replace with `list`
   |
33 |
   - def f(x: int) -> List[int]:
34 + def f(x: int) -> list[int]:
35 |     y = List[int]()
   |

UP006 [*] Use `list` instead of `List` for type annotation
  --> future_annotations.py:35:9
   |
34 | def f(x: int) -> List[int]:
35 |     y = List[int]()
   |         ^^^^
36 |     y.append(x)
37 |     return y
   |
help: Replace with `list`
   |
34 | def f(x: int) -> List[int]:
   -     y = List[int]()
35 +     y = list[int]()
36 |     y.append(x)
   |

UP006 [*] Use `list` instead of `List` for type annotation
  --> future_annotations.py:42:27
   |
40 | x: Optional[int] = None
41 |
42 | MyList: TypeAlias = Union[List[int], List[str]]
   |                           ^^^^
   |
help: Replace with `list`
   |
41 |
   - MyList: TypeAlias = Union[List[int], List[str]]
42 + MyList: TypeAlias = Union[list[int], List[str]]
   |

UP006 [*] Use `list` instead of `List` for type annotation
  --> future_annotations.py:42:38
   |
40 | x: Optional[int] = None
41 |
42 | MyList: TypeAlias = Union[List[int], List[str]]
   |                                      ^^^^
   |
help: Replace with `list`
   |
41 |
   - MyList: TypeAlias = Union[List[int], List[str]]
42 + MyList: TypeAlias = Union[List[int], list[str]]
   |
