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

ℹ Safe fix
31 31 |         return cls(x=0, y=0)
32 32 | 
33 33 | 
34    |-def f(x: int) -> List[int]:
   34 |+def f(x: int) -> list[int]:
35 35 |     y = List[int]()
36 36 |     y.append(x)
37 37 |     return y

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

ℹ Safe fix
32 32 | 
33 33 | 
34 34 | def f(x: int) -> List[int]:
35    |-    y = List[int]()
   35 |+    y = list[int]()
36 36 |     y.append(x)
37 37 |     return y
38 38 | 

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

ℹ Safe fix
39 39 | 
40 40 | x: Optional[int] = None
41 41 | 
42    |-MyList: TypeAlias = Union[List[int], List[str]]
   42 |+MyList: TypeAlias = Union[list[int], List[str]]

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

ℹ Safe fix
39 39 | 
40 40 | x: Optional[int] = None
41 41 | 
42    |-MyList: TypeAlias = Union[List[int], List[str]]
   42 |+MyList: TypeAlias = Union[List[int], list[str]]
