---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:10:14
   |
 8 | def f12(
 9 |     x,
10 |     y: str = os.pathsep,  # Error PYI011 Only simple default values allowed for typed arguments
   |              ^^^^^^^^^^
11 | ) -> None: ...
12 | def f11(*, x: str = "x") -> None: ...  # OK
   |
help: Replace default value with `...`
   |
9  |     x,
   -     y: str = os.pathsep,  # Error PYI011 Only simple default values allowed for typed arguments
10 +     y: str = ...,  # Error PYI011 Only simple default values allowed for typed arguments
11 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:38:9
   |
36 |       x: dict[
37 |           int, int
38 |       ] = {  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
39 | |         1: 2,
40 | |         **{3: 4},
41 | |     }
   | |_____^
42 |   ) -> None: ...
43 |   def f153(
   |
help: Replace default value with `...`
   |
37 |         int, int
   -     ] = {  # Error PYI011 Only simple default values allowed for typed arguments
   -         1: 2,
   -         **{3: 4},
   -     }
38 +     ] = ...
39 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:46:9
   |
44 |       x: list[
45 |           int
46 |       ] = [  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
47 | |         1,
48 | |         2,
49 | |         3,
50 | |         4,
51 | |         5,
52 | |         6,
53 | |         7,
54 | |         8,
55 | |         9,
56 | |         10,
57 | |         11,
58 | |     ]
   | |_____^
59 |   ) -> None: ...
60 |   def f154(
   |
help: Replace default value with `...`
   |
45 |         int
   -     ] = [  # Error PYI011 Only simple default values allowed for typed arguments
   -         1,
   -         2,
   -         3,
   -         4,
   -         5,
   -         6,
   -         7,
   -         8,
   -         9,
   -         10,
   -         11,
   -     ]
46 +     ] = ...
47 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:63:9
   |
61 |       x: tuple[
62 |           str, tuple[str, ...]
63 |       ] = (  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
64 | |         "foo",
65 | |         ("bar", "baz"),
66 | |     )
   | |_____^
67 |   ) -> None: ...
68 |   def f141(
   |
help: Replace default value with `...`
   |
62 |         str, tuple[str, ...]
   -     ] = (  # Error PYI011 Only simple default values allowed for typed arguments
   -         "foo",
   -         ("bar", "baz"),
   -     )
63 +     ] = ...
64 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:71:9
   |
69 |       x: list[
70 |           int
71 |       ] = [  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
72 | |         *range(10)
73 | |     ],
   | |_____^
74 |   ) -> None: ...
75 |   def f142(
   |
help: Replace default value with `...`
   |
70 |         int
   -     ] = [  # Error PYI011 Only simple default values allowed for typed arguments
   -         *range(10)
   -     ],
71 +     ] = ...,
72 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:78:9
   |
76 |       x: list[
77 |           int
78 |       ] = list(  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
79 | |         range(10)
80 | |     ),
   | |_____^
81 |   ) -> None: ...
82 |   def f16(
   |
help: Replace default value with `...`
   |
77 |         int
   -     ] = list(  # Error PYI011 Only simple default values allowed for typed arguments
   -         range(10)
   -     ),
78 +     ] = ...,
79 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:85:9
   |
83 |       x: frozenset[
84 |           bytes
85 |       ] = frozenset(  # Error PYI011 Only simple default values allowed for typed arguments
   |  _________^
86 | |         {b"foo", b"bar", b"baz"}
87 | |     )
   | |_____^
88 |   ) -> None: ...
89 |   def f17(
   |
help: Replace default value with `...`
   |
84 |         bytes
   -     ] = frozenset(  # Error PYI011 Only simple default values allowed for typed arguments
   -         {b"foo", b"bar", b"baz"}
   -     )
85 +     ] = ...
86 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:90:14
   |
88 |   ) -> None: ...
89 |   def f17(
90 |       x: str = "foo"  # Error PYI011 Only simple default values allowed for typed arguments
   |  ______________^
91 | |     + "bar",
   | |___________^
92 |   ) -> None: ...
93 |   def f18(
   |
help: Replace default value with `...`
   |
89 | def f17(
   -     x: str = "foo"  # Error PYI011 Only simple default values allowed for typed arguments
   -     + "bar",
90 +     x: str = ...,
91 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
  --> PYI011.pyi:94:14
   |
92 |   ) -> None: ...
93 |   def f18(
94 |       x: str = b"foo"  # Error PYI011 Only simple default values allowed for typed arguments
   |  ______________^
95 | |     + b"bar",
   | |____________^
96 |   ) -> None: ...
97 |   def f19(
   |
help: Replace default value with `...`
   |
93 | def f18(
   -     x: str = b"foo"  # Error PYI011 Only simple default values allowed for typed arguments
   -     + b"bar",
94 +     x: str = ...,
95 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:98:17
    |
 96 |   ) -> None: ...
 97 |   def f19(
 98 |       x: object = "foo"  # Error PYI011 Only simple default values allowed for typed arguments
    |  _________________^
 99 | |     + 4,
    | |_______^
100 |   ) -> None: ...
101 |   def f20(
    |
help: Replace default value with `...`
   |
97 | def f19(
   -     x: object = "foo"  # Error PYI011 Only simple default values allowed for typed arguments
   -     + 4,
98 +     x: object = ...,
99 | ) -> None: ...
   |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:102:14
    |
100 |   ) -> None: ...
101 |   def f20(
102 |       x: int = 5
    |  ______________^
103 | |     + 5,  # Error PYI011 Only simple default values allowed for typed arguments
    | |_______^
104 |   ) -> None: ...
105 |   def f21(
    |
help: Replace default value with `...`
    |
101 | def f20(
    -     x: int = 5
    -     + 5,  # Error PYI011 Only simple default values allowed for typed arguments
102 +     x: int = ...,  # Error PYI011 Only simple default values allowed for typed arguments
103 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:106:18
    |
104 |   ) -> None: ...
105 |   def f21(
106 |       x: complex = 3j
    |  __________________^
107 | |     - 3j,  # Error PYI011 Only simple default values allowed for typed arguments
    | |________^
108 |   ) -> None: ...
109 |   def f22(
    |
help: Replace default value with `...`
    |
105 | def f21(
    -     x: complex = 3j
    -     - 3j,  # Error PYI011 Only simple default values allowed for typed arguments
106 +     x: complex = ...,  # Error PYI011 Only simple default values allowed for typed arguments
107 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:110:18
    |
108 |   ) -> None: ...
109 |   def f22(
110 |       x: complex = -42.5j  # Error PYI011 Only simple default values allowed for typed arguments
    |  __________________^
111 | |     + 4.3j,
    | |__________^
112 |   ) -> None: ...
113 |   def f23(
    |
help: Replace default value with `...`
    |
109 | def f22(
    -     x: complex = -42.5j  # Error PYI011 Only simple default values allowed for typed arguments
    -     + 4.3j,
110 +     x: complex = ...,
111 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:138:16
    |
136 | ) -> None: ...
137 | def f31(
138 |     x: float = inf,  # Error PYI011 Only simple default values allowed for typed arguments
    |                ^^^
139 | ) -> None: ...
140 | def f32(
    |
help: Replace default value with `...`
    |
137 | def f31(
    -     x: float = inf,  # Error PYI011 Only simple default values allowed for typed arguments
138 +     x: float = ...,  # Error PYI011 Only simple default values allowed for typed arguments
139 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:141:16
    |
139 | ) -> None: ...
140 | def f32(
141 |     x: float = np.inf,  # Error PYI011 Only simple default values allowed for typed arguments
    |                ^^^^^^
142 | ) -> None: ...
143 | def f33(
    |
help: Replace default value with `...`
    |
140 | def f32(
    -     x: float = np.inf,  # Error PYI011 Only simple default values allowed for typed arguments
141 +     x: float = ...,  # Error PYI011 Only simple default values allowed for typed arguments
142 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:147:16
    |
145 | ) -> None: ...
146 | def f34(
147 |     x: float = -math.nan,  # Error PYI011 Only simple default values allowed for typed arguments
    |                ^^^^^^^^^
148 | ) -> None: ...
149 | def f35(
    |
help: Replace default value with `...`
    |
146 | def f34(
    -     x: float = -math.nan,  # Error PYI011 Only simple default values allowed for typed arguments
147 +     x: float = ...,  # Error PYI011 Only simple default values allowed for typed arguments
148 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:150:18
    |
148 |   ) -> None: ...
149 |   def f35(
150 |       x: complex = math.inf  # Error PYI011 Only simple default values allowed for typed arguments
    |  __________________^
151 | |     + 1j,
    | |________^
152 |   ) -> None: ...
153 |   def f36(
    |
help: Replace default value with `...`
    |
149 | def f35(
    -     x: complex = math.inf  # Error PYI011 Only simple default values allowed for typed arguments
    -     + 1j,
150 +     x: complex = ...,
151 | ) -> None: ...
    |

PYI011 [*] Only simple default values allowed for typed arguments
   --> PYI011.pyi:159:14
    |
157 |   def f37(
158 |       *,
159 |       x: str = ""  # Error PYI011 Only simple default values allowed for typed arguments
    |  ______________^
160 | |     + "",
    | |________^
161 |   ) -> None: ...
    |
help: Replace default value with `...`
    |
158 |     *,
    -     x: str = ""  # Error PYI011 Only simple default values allowed for typed arguments
    -     + "",
159 +     x: str = ...,
160 | ) -> None: ...
    |
