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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

UP006 [*] Use `collections.deque` instead of `typing.Deque` for type annotation
  --> UP006_0.py:61:10
   |
61 | def f(x: typing.Deque[str]) -> None:
   |          ^^^^^^^^^^^^
62 |     ...
   |
help: Replace with `collections.deque`
   |
22 | from typing import List as IList
23 + from collections import deque
24 |
--------------------------------------------------------------------------------
61 |
   - def f(x: typing.Deque[str]) -> None:
62 + def f(x: deque[str]) -> None:
63 |     ...
   |

UP006 [*] Use `collections.defaultdict` instead of `typing.DefaultDict` for type annotation
  --> UP006_0.py:65:10
   |
65 | def f(x: typing.DefaultDict[str, str]) -> None:
   |          ^^^^^^^^^^^^^^^^^^
66 |     ...
   |
help: Replace with `collections.defaultdict`
   |
22 | from typing import List as IList
23 + from collections import defaultdict
24 |
--------------------------------------------------------------------------------
65 |
   - def f(x: typing.DefaultDict[str, str]) -> None:
66 + def f(x: defaultdict[str, str]) -> None:
67 |     ...
   |
