---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
snapshot_kind: text
---
UP006_0.py:4:10: UP006 [*] Use `list` instead of `typing.List` for type annotation
  |
4 | def f(x: typing.List[str]) -> None:
  |          ^^^^^^^^^^^ UP006
5 |     ...
  |
  = help: Replace with `list`

ℹ Safe fix
1 1 | import typing
2 2 | 
3 3 | 
4   |-def f(x: typing.List[str]) -> None:
  4 |+def f(x: list[str]) -> None:
5 5 |     ...
6 6 | 
7 7 | 

UP006_0.py:11:10: UP006 [*] Use `list` instead of `List` for type annotation
   |
11 | def f(x: List[str]) -> None:
   |          ^^^^ UP006
12 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
8  8  | from typing import List
9  9  | 
10 10 | 
11    |-def f(x: List[str]) -> None:
   11 |+def f(x: list[str]) -> None:
12 12 |     ...
13 13 | 
14 14 | 

UP006_0.py:18:10: UP006 [*] Use `list` instead of `t.List` for type annotation
   |
18 | def f(x: t.List[str]) -> None:
   |          ^^^^^^ UP006
19 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
15 15 | import typing as t
16 16 | 
17 17 | 
18    |-def f(x: t.List[str]) -> None:
   18 |+def f(x: list[str]) -> None:
19 19 |     ...
20 20 | 
21 21 | 

UP006_0.py:25:10: UP006 [*] Use `list` instead of `IList` for type annotation
   |
25 | def f(x: IList[str]) -> None:
   |          ^^^^^ UP006
26 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
22 22 | from typing import List as IList
23 23 | 
24 24 | 
25    |-def f(x: IList[str]) -> None:
   25 |+def f(x: list[str]) -> None:
26 26 |     ...
27 27 | 
28 28 | 

UP006_0.py:29:11: UP006 [*] Use `list` instead of `List` for type annotation
   |
29 | def f(x: "List[str]") -> None:
   |           ^^^^ UP006
30 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
26 26 |     ...
27 27 | 
28 28 | 
29    |-def f(x: "List[str]") -> None:
   29 |+def f(x: "list[str]") -> None:
30 30 |     ...
31 31 | 
32 32 | 

UP006_0.py:33:12: UP006 [*] Use `list` instead of `List` for type annotation
   |
33 | def f(x: r"List[str]") -> None:
   |            ^^^^ UP006
34 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
30 30 |     ...
31 31 | 
32 32 | 
33    |-def f(x: r"List[str]") -> None:
   33 |+def f(x: r"list[str]") -> None:
34 34 |     ...
35 35 | 
36 36 | 

UP006_0.py:37:11: UP006 [*] Use `list` instead of `List` for type annotation
   |
37 | def f(x: "List[str]") -> None:
   |           ^^^^ UP006
38 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
34 34 |     ...
35 35 | 
36 36 | 
37    |-def f(x: "List[str]") -> None:
   37 |+def f(x: "list[str]") -> None:
38 38 |     ...
39 39 | 
40 40 | 

UP006_0.py:41:13: UP006 [*] Use `list` instead of `List` for type annotation
   |
41 | def f(x: """List[str]""") -> None:
   |             ^^^^ UP006
42 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
38 38 |     ...
39 39 | 
40 40 | 
41    |-def f(x: """List[str]""") -> None:
   41 |+def f(x: """list[str]""") -> None:
42 42 |     ...
43 43 | 
44 44 | 

UP006_0.py:45:10: UP006 Use `list` instead of `List` for type annotation
   |
45 | def f(x: "Li" "st[str]") -> None:
   |          ^^^^^^^^^^^^^^ UP006
46 |     ...
   |
   = help: Replace with `list`

UP006_0.py:49:11: UP006 [*] Use `list` instead of `List` for type annotation
   |
49 | def f(x: "List['List[str]']") -> None:
   |           ^^^^ UP006
50 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
46 46 |     ...
47 47 | 
48 48 | 
49    |-def f(x: "List['List[str]']") -> None:
   49 |+def f(x: "list['List[str]']") -> None:
50 50 |     ...
51 51 | 
52 52 | 

UP006_0.py:49:17: UP006 [*] Use `list` instead of `List` for type annotation
   |
49 | def f(x: "List['List[str]']") -> None:
   |                 ^^^^ UP006
50 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
46 46 |     ...
47 47 | 
48 48 | 
49    |-def f(x: "List['List[str]']") -> None:
   49 |+def f(x: "List['list[str]']") -> None:
50 50 |     ...
51 51 | 
52 52 | 

UP006_0.py:53:11: UP006 [*] Use `list` instead of `List` for type annotation
   |
53 | def f(x: "List['Li' 'st[str]']") -> None:
   |           ^^^^ UP006
54 |     ...
   |
   = help: Replace with `list`

ℹ Safe fix
50 50 |     ...
51 51 | 
52 52 | 
53    |-def f(x: "List['Li' 'st[str]']") -> None:
   53 |+def f(x: "list['Li' 'st[str]']") -> None:
54 54 |     ...
55 55 | 
56 56 | 

UP006_0.py:53:16: UP006 Use `list` instead of `List` for type annotation
   |
53 | def f(x: "List['Li' 'st[str]']") -> None:
   |                ^^^^^^^^^^^^^^ UP006
54 |     ...
   |
   = help: Replace with `list`

UP006_0.py:57:10: UP006 Use `list` instead of `List` for type annotation
   |
57 | def f(x: "Li" "st['List[str]']") -> None:
   |          ^^^^^^^^^^^^^^^^^^^^^^ UP006
58 |     ...
   |
   = help: Replace with `list`

UP006_0.py:57:10: UP006 Use `list` instead of `List` for type annotation
   |
57 | def f(x: "Li" "st['List[str]']") -> None:
   |          ^^^^^^^^^^^^^^^^^^^^^^ UP006
58 |     ...
   |
   = help: Replace with `list`

UP006_0.py:61:10: UP006 [*] Use `collections.deque` instead of `typing.Deque` for type annotation
   |
61 | def f(x: typing.Deque[str]) -> None:
   |          ^^^^^^^^^^^^ UP006
62 |     ...
   |
   = help: Replace with `collections.deque`

ℹ Safe fix
20 20 | 
21 21 | 
22 22 | from typing import List as IList
   23 |+from collections import deque
23 24 | 
24 25 | 
25 26 | def f(x: IList[str]) -> None:
--------------------------------------------------------------------------------
58 59 |     ...
59 60 | 
60 61 | 
61    |-def f(x: typing.Deque[str]) -> None:
   62 |+def f(x: deque[str]) -> None:
62 63 |     ...
63 64 | 
64 65 | 

UP006_0.py:65:10: UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation
   |
65 | def f(x: typing.DefaultDict[str, str]) -> None:
   |          ^^^^^^^^^^^^^^^^^^ UP006
66 |     ...
   |
   = help: Replace with `collections.defaultdict`

ℹ Safe fix
20 20 | 
21 21 | 
22 22 | from typing import List as IList
   23 |+from collections import defaultdict
23 24 | 
24 25 | 
25 26 | def f(x: IList[str]) -> None:
--------------------------------------------------------------------------------
62 63 |     ...
63 64 | 
64 65 | 
65    |-def f(x: typing.DefaultDict[str, str]) -> None:
   66 |+def f(x: defaultdict[str, str]) -> None:
66 67 |     ...
