---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:44:23
   |
43 | # We *should* emit Y015 for more complex default values
44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  # Y015 Only simple default values are allowed for assignments
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
43 | # We *should* emit Y015 for more complex default values
   - field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  # Y015 Only simple default values are allowed for assignments
44 + field221: list[int] = ...  # Y015 Only simple default values are allowed for assignments
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:45:23
   |
43 | # We *should* emit Y015 for more complex default values
44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  # Y015 Only simple default values are allowed for assignments
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
   |                       ^^^^^^^^^^^^
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  # Y015 Only simple default values are allowed for assignments
   - field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
45 + field223: list[int] = ...  # Y015 Only simple default values are allowed for assignments
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:46:23
   |
44 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]  # Y015 Only simple default values are allowed for assignments
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
   |                       ^^^^^^^^^^^^^^^
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
   - field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
46 + field224: list[int] = ...  # Y015 Only simple default values are allowed for assignments
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:47:26
   |
45 | field223: list[int] = [*range(10)]  # Y015 Only simple default values are allowed for assignments
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
   |                          ^^^^^^^^^^
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
   - field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
47 + field225: list[object] = ...  # Y015 Only simple default values are allowed for assignments
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:48:47
   |
46 | field224: list[int] = list(range(10))  # Y015 Only simple default values are allowed for assignments
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
50 | field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
   - field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
48 + field226: tuple[str | tuple[str, ...], ...] = ...  # Y015 Only simple default values are allowed for assignments
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:49:31
   |
47 | field225: list[object] = [{}, 1, 2]  # Y015 Only simple default values are allowed for assignments
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
   |                               ^^^^^^^^^^^^^^^^^^^^^^^
50 | field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
   |
help: Replace default value with `...`
   |
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
   - field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
49 + field227: dict[str, object] = ...  # Y015 Only simple default values are allowed for assignments
50 | field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:50:37
   |
48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar"))  # Y015 Only simple default values are allowed for assignments
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
50 | field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
   |                                     ^^^^^^^^^^^
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
52 | field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
49 | field227: dict[str, object] = {"foo": {"foo": "bar"}}  # Y015 Only simple default values are allowed for assignments
   - field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
50 + field228: dict[str, list[object]] = ...  # Y015 Only simple default values are allowed for assignments
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:52:28
   |
50 | field228: dict[str, list[object]] = {"foo": []}  # Y015 Only simple default values are allowed for assignments
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
52 | field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
   |                            ^^^^^^^^^^^^^^^^
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
   - field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
52 + field229: dict[int, int] = ...  # Y015 Only simple default values are allowed for assignments
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:53:11
   |
51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node
52 | field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
   |           ^^^^^^^^^^^^^
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
55 | field25 = 5 * 5  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
52 | field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
   - field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
53 + field23 = ...  # Y015 Only simple default values are allowed for assignments
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:54:11
   |
52 | field229: dict[int, int] = {1: 2, **{3: 4}}  # Y015 Only simple default values are allowed for assignments
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
   |           ^^^^^^^^^^^^^^^
55 | field25 = 5 * 5  # Y015 Only simple default values are allowed for assignments
   |
help: Replace default value with `...`
   |
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
   - field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
54 + field24 = ...  # Y015 Only simple default values are allowed for assignments
55 | field25 = 5 * 5  # Y015 Only simple default values are allowed for assignments
   |

PYI015 [*] Only simple default values allowed for assignments
  --> PYI015.pyi:55:11
   |
53 | field23 = "foo" + "bar"  # Y015 Only simple default values are allowed for assignments
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
55 | field25 = 5 * 5  # Y015 Only simple default values are allowed for assignments
   |           ^^^^^
56 |
57 | # We shouldn't emit Y015 within functions
   |
help: Replace default value with `...`
   |
54 | field24 = b"foo" + b"bar"  # Y015 Only simple default values are allowed for assignments
   - field25 = 5 * 5  # Y015 Only simple default values are allowed for assignments
55 + field25 = ...  # Y015 Only simple default values are allowed for assignments
56 |
   |
