---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP037.py:18:14: UP037 [*] Remove quotes from type annotation
   |
18 | def foo(var: "MyClass") -> "MyClass":
   |              ^^^^^^^^^ UP037
19 |     x: "MyClass"
   |
   = help: Remove quotes

ℹ Safe fix
15 15 | from mypy_extensions import Arg, DefaultArg, DefaultNamedArg, NamedArg, VarArg
16 16 | 
17 17 | 
18    |-def foo(var: "MyClass") -> "MyClass":
   18 |+def foo(var: MyClass) -> "MyClass":
19 19 |     x: "MyClass"
20 20 | 
21 21 | 

UP037.py:18:28: UP037 [*] Remove quotes from type annotation
   |
18 | def foo(var: "MyClass") -> "MyClass":
   |                            ^^^^^^^^^ UP037
19 |     x: "MyClass"
   |
   = help: Remove quotes

ℹ Safe fix
15 15 | from mypy_extensions import Arg, DefaultArg, DefaultNamedArg, NamedArg, VarArg
16 16 | 
17 17 | 
18    |-def foo(var: "MyClass") -> "MyClass":
   18 |+def foo(var: "MyClass") -> MyClass:
19 19 |     x: "MyClass"
20 20 | 
21 21 | 

UP037.py:19:8: UP037 [*] Remove quotes from type annotation
   |
18 | def foo(var: "MyClass") -> "MyClass":
19 |     x: "MyClass"
   |        ^^^^^^^^^ UP037
   |
   = help: Remove quotes

ℹ Safe fix
16 16 | 
17 17 | 
18 18 | def foo(var: "MyClass") -> "MyClass":
19    |-    x: "MyClass"
   19 |+    x: MyClass
20 20 | 
21 21 | 
22 22 | def foo(*, inplace: "bool"):

UP037.py:22:21: UP037 [*] Remove quotes from type annotation
   |
22 | def foo(*, inplace: "bool"):
   |                     ^^^^^^ UP037
23 |     pass
   |
   = help: Remove quotes

ℹ Safe fix
19 19 |     x: "MyClass"
20 20 | 
21 21 | 
22    |-def foo(*, inplace: "bool"):
   22 |+def foo(*, inplace: bool):
23 23 |     pass
24 24 | 
25 25 | 

UP037.py:26:16: UP037 [*] Remove quotes from type annotation
   |
26 | def foo(*args: "str", **kwargs: "int"):
   |                ^^^^^ UP037
27 |     pass
   |
   = help: Remove quotes

ℹ Safe fix
23 23 |     pass
24 24 | 
25 25 | 
26    |-def foo(*args: "str", **kwargs: "int"):
   26 |+def foo(*args: str, **kwargs: "int"):
27 27 |     pass
28 28 | 
29 29 | 

UP037.py:26:33: UP037 [*] Remove quotes from type annotation
   |
26 | def foo(*args: "str", **kwargs: "int"):
   |                                 ^^^^^ UP037
27 |     pass
   |
   = help: Remove quotes

ℹ Safe fix
23 23 |     pass
24 24 | 
25 25 | 
26    |-def foo(*args: "str", **kwargs: "int"):
   26 |+def foo(*args: "str", **kwargs: int):
27 27 |     pass
28 28 | 
29 29 | 

UP037.py:30:10: UP037 [*] Remove quotes from type annotation
   |
30 | x: Tuple["MyClass"]
   |          ^^^^^^^^^ UP037
31 | 
32 | x: Callable[["MyClass"], None]
   |
   = help: Remove quotes

ℹ Safe fix
27 27 |     pass
28 28 | 
29 29 | 
30    |-x: Tuple["MyClass"]
   30 |+x: Tuple[MyClass]
31 31 | 
32 32 | x: Callable[["MyClass"], None]
33 33 | 

UP037.py:32:14: UP037 [*] Remove quotes from type annotation
   |
30 | x: Tuple["MyClass"]
31 | 
32 | x: Callable[["MyClass"], None]
   |              ^^^^^^^^^ UP037
   |
   = help: Remove quotes

ℹ Safe fix
29 29 | 
30 30 | x: Tuple["MyClass"]
31 31 | 
32    |-x: Callable[["MyClass"], None]
   32 |+x: Callable[[MyClass], None]
33 33 | 
34 34 | 
35 35 | class Foo(NamedTuple):

UP037.py:36:8: UP037 [*] Remove quotes from type annotation
   |
35 | class Foo(NamedTuple):
36 |     x: "MyClass"
   |        ^^^^^^^^^ UP037
   |
   = help: Remove quotes

ℹ Safe fix
33 33 | 
34 34 | 
35 35 | class Foo(NamedTuple):
36    |-    x: "MyClass"
   36 |+    x: MyClass
37 37 | 
38 38 | 
39 39 | class D(TypedDict):

UP037.py:40:27: UP037 [*] Remove quotes from type annotation
   |
39 | class D(TypedDict):
40 |     E: TypedDict("E", foo="int", total=False)
   |                           ^^^^^ UP037
   |
   = help: Remove quotes

ℹ Safe fix
37 37 | 
38 38 | 
39 39 | class D(TypedDict):
40    |-    E: TypedDict("E", foo="int", total=False)
   40 |+    E: TypedDict("E", foo=int, total=False)
41 41 | 
42 42 | 
43 43 | class D(TypedDict):

UP037.py:44:31: UP037 [*] Remove quotes from type annotation
   |
43 | class D(TypedDict):
44 |     E: TypedDict("E", {"foo": "int"})
   |                               ^^^^^ UP037
   |
   = help: Remove quotes

ℹ Safe fix
41 41 | 
42 42 | 
43 43 | class D(TypedDict):
44    |-    E: TypedDict("E", {"foo": "int"})
   44 |+    E: TypedDict("E", {"foo": int})
45 45 | 
46 46 | 
47 47 | x: Annotated["str", "metadata"]

UP037.py:47:14: UP037 [*] Remove quotes from type annotation
   |
47 | x: Annotated["str", "metadata"]
   |              ^^^^^ UP037
48 | 
49 | x: Arg("str", "name")
   |
   = help: Remove quotes

ℹ Safe fix
44 44 |     E: TypedDict("E", {"foo": "int"})
45 45 | 
46 46 | 
47    |-x: Annotated["str", "metadata"]
   47 |+x: Annotated[str, "metadata"]
48 48 | 
49 49 | x: Arg("str", "name")
50 50 | 

UP037.py:49:8: UP037 [*] Remove quotes from type annotation
   |
47 | x: Annotated["str", "metadata"]
48 | 
49 | x: Arg("str", "name")
   |        ^^^^^ UP037
50 | 
51 | x: DefaultArg("str", "name")
   |
   = help: Remove quotes

ℹ Safe fix
46 46 | 
47 47 | x: Annotated["str", "metadata"]
48 48 | 
49    |-x: Arg("str", "name")
   49 |+x: Arg(str, "name")
50 50 | 
51 51 | x: DefaultArg("str", "name")
52 52 | 

UP037.py:51:15: UP037 [*] Remove quotes from type annotation
   |
49 | x: Arg("str", "name")
50 | 
51 | x: DefaultArg("str", "name")
   |               ^^^^^ UP037
52 | 
53 | x: NamedArg("str", "name")
   |
   = help: Remove quotes

ℹ Safe fix
48 48 | 
49 49 | x: Arg("str", "name")
50 50 | 
51    |-x: DefaultArg("str", "name")
   51 |+x: DefaultArg(str, "name")
52 52 | 
53 53 | x: NamedArg("str", "name")
54 54 | 

UP037.py:53:13: UP037 [*] Remove quotes from type annotation
   |
51 | x: DefaultArg("str", "name")
52 | 
53 | x: NamedArg("str", "name")
   |             ^^^^^ UP037
54 | 
55 | x: DefaultNamedArg("str", "name")
   |
   = help: Remove quotes

ℹ Safe fix
50 50 | 
51 51 | x: DefaultArg("str", "name")
52 52 | 
53    |-x: NamedArg("str", "name")
   53 |+x: NamedArg(str, "name")
54 54 | 
55 55 | x: DefaultNamedArg("str", "name")
56 56 | 

UP037.py:55:20: UP037 [*] Remove quotes from type annotation
   |
53 | x: NamedArg("str", "name")
54 | 
55 | x: DefaultNamedArg("str", "name")
   |                    ^^^^^ UP037
56 | 
57 | x: DefaultNamedArg("str", name="name")
   |
   = help: Remove quotes

ℹ Safe fix
52 52 | 
53 53 | x: NamedArg("str", "name")
54 54 | 
55    |-x: DefaultNamedArg("str", "name")
   55 |+x: DefaultNamedArg(str, "name")
56 56 | 
57 57 | x: DefaultNamedArg("str", name="name")
58 58 | 

UP037.py:57:20: UP037 [*] Remove quotes from type annotation
   |
55 | x: DefaultNamedArg("str", "name")
56 | 
57 | x: DefaultNamedArg("str", name="name")
   |                    ^^^^^ UP037
58 | 
59 | x: VarArg("str")
   |
   = help: Remove quotes

ℹ Safe fix
54 54 | 
55 55 | x: DefaultNamedArg("str", "name")
56 56 | 
57    |-x: DefaultNamedArg("str", name="name")
   57 |+x: DefaultNamedArg(str, name="name")
58 58 | 
59 59 | x: VarArg("str")
60 60 | 

UP037.py:59:11: UP037 [*] Remove quotes from type annotation
   |
57 | x: DefaultNamedArg("str", name="name")
58 | 
59 | x: VarArg("str")
   |           ^^^^^ UP037
60 | 
61 | x: List[List[List["MyClass"]]]
   |
   = help: Remove quotes

ℹ Safe fix
56 56 | 
57 57 | x: DefaultNamedArg("str", name="name")
58 58 | 
59    |-x: VarArg("str")
   59 |+x: VarArg(str)
60 60 | 
61 61 | x: List[List[List["MyClass"]]]
62 62 | 

UP037.py:61:19: UP037 [*] Remove quotes from type annotation
   |
59 | x: VarArg("str")
60 | 
61 | x: List[List[List["MyClass"]]]
   |                   ^^^^^^^^^ UP037
62 | 
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
   |
   = help: Remove quotes

ℹ Safe fix
58 58 | 
59 59 | x: VarArg("str")
60 60 | 
61    |-x: List[List[List["MyClass"]]]
   61 |+x: List[List[List[MyClass]]]
62 62 | 
63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 64 | 

UP037.py:63:29: UP037 [*] Remove quotes from type annotation
   |
61 | x: List[List[List["MyClass"]]]
62 | 
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
   |                             ^^^^^ UP037
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |
   = help: Remove quotes

ℹ Safe fix
60 60 | 
61 61 | x: List[List[List["MyClass"]]]
62 62 | 
63    |-x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
   63 |+x: NamedTuple("X", [("foo", int), ("bar", "str")])
64 64 | 
65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 66 | 

UP037.py:63:45: UP037 [*] Remove quotes from type annotation
   |
61 | x: List[List[List["MyClass"]]]
62 | 
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
   |                                             ^^^^^ UP037
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |
   = help: Remove quotes

ℹ Safe fix
60 60 | 
61 61 | x: List[List[List["MyClass"]]]
62 62 | 
63    |-x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
   63 |+x: NamedTuple("X", [("foo", "int"), ("bar", str)])
64 64 | 
65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 66 | 

UP037.py:65:29: UP037 [*] Remove quotes from type annotation
   |
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |                             ^^^^^ UP037
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |
   = help: Remove quotes

ℹ Safe fix
62 62 | 
63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 64 | 
65    |-x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   65 |+x: NamedTuple("X", fields=[(foo, "int"), ("bar", "str")])
66 66 | 
67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
68 68 | 

UP037.py:65:36: UP037 [*] Remove quotes from type annotation
   |
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |                                    ^^^^^ UP037
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |
   = help: Remove quotes

ℹ Safe fix
62 62 | 
63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 64 | 
65    |-x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   65 |+x: NamedTuple("X", fields=[("foo", int), ("bar", "str")])
66 66 | 
67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
68 68 | 

UP037.py:65:45: UP037 [*] Remove quotes from type annotation
   |
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |                                             ^^^^^ UP037
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |
   = help: Remove quotes

ℹ Safe fix
62 62 | 
63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 64 | 
65    |-x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   65 |+x: NamedTuple("X", fields=[("foo", "int"), (bar, "str")])
66 66 | 
67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
68 68 | 

UP037.py:65:52: UP037 [*] Remove quotes from type annotation
   |
63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 | 
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   |                                                    ^^^^^ UP037
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |
   = help: Remove quotes

ℹ Safe fix
62 62 | 
63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")])
64 64 | 
65    |-x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
   65 |+x: NamedTuple("X", fields=[("foo", "int"), ("bar", str)])
66 66 | 
67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
68 68 | 

UP037.py:67:24: UP037 [*] Remove quotes from type annotation
   |
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |                        ^^^ UP037
68 | 
69 | X: MyCallable("X")
   |
   = help: Remove quotes

ℹ Safe fix
64 64 | 
65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 66 | 
67    |-x: NamedTuple(typename="X", fields=[("foo", "int")])
   67 |+x: NamedTuple(typename=X, fields=[("foo", "int")])
68 68 | 
69 69 | X: MyCallable("X")
70 70 | 

UP037.py:67:38: UP037 [*] Remove quotes from type annotation
   |
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |                                      ^^^^^ UP037
68 | 
69 | X: MyCallable("X")
   |
   = help: Remove quotes

ℹ Safe fix
64 64 | 
65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 66 | 
67    |-x: NamedTuple(typename="X", fields=[("foo", "int")])
   67 |+x: NamedTuple(typename="X", fields=[(foo, "int")])
68 68 | 
69 69 | X: MyCallable("X")
70 70 | 

UP037.py:67:45: UP037 [*] Remove quotes from type annotation
   |
65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 | 
67 | x: NamedTuple(typename="X", fields=[("foo", "int")])
   |                                             ^^^^^ UP037
68 | 
69 | X: MyCallable("X")
   |
   = help: Remove quotes

ℹ Safe fix
64 64 | 
65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")])
66 66 | 
67    |-x: NamedTuple(typename="X", fields=[("foo", "int")])
   67 |+x: NamedTuple(typename="X", fields=[("foo", int)])
68 68 | 
69 69 | X: MyCallable("X")
70 70 | 


