---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
  --> dict_iter_missing_items.py:13:13
   |
12 | # Errors
13 | for k, v in d:
   |             ^
14 |     pass
   |
help: Add a call to `.items()`
   |
12 | # Errors
   - for k, v in d:
13 + for k, v in d.items():
14 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
  --> dict_iter_missing_items.py:16:13
   |
14 |     pass
15 |
16 | for k, v in d_tuple_incorrect_tuple:
   |             ^^^^^^^^^^^^^^^^^^^^^^^
17 |     pass
   |
help: Add a call to `.items()`
   |
15 |
   - for k, v in d_tuple_incorrect_tuple:
16 + for k, v in d_tuple_incorrect_tuple.items():
17 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
  --> dict_iter_missing_items.py:37:13
   |
35 | empty_dict = {}
36 | empty_dict["x"] = 1
37 | for k, v in empty_dict:
   |             ^^^^^^^^^^
38 |     pass
   |
help: Add a call to `.items()`
   |
36 | empty_dict["x"] = 1
   - for k, v in empty_dict:
37 + for k, v in empty_dict.items():
38 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
  --> dict_iter_missing_items.py:46:13
   |
44 | empty_dict_unannotated = {}
45 | empty_dict_unannotated[("x", "y")] = True
46 | for k, v in empty_dict_unannotated:
   |             ^^^^^^^^^^^^^^^^^^^^^^
47 |     pass
   |
help: Add a call to `.items()`
   |
45 | empty_dict_unannotated[("x", "y")] = True
   - for k, v in empty_dict_unannotated:
46 + for k, v in empty_dict_unannotated.items():
47 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

PLE1141 [*] Unpacking a dictionary in iteration without calling `.items()`
  --> dict_iter_missing_items.py:51:13
   |
49 | empty_dict_annotated_str_keys: dict[str, int] = {}
50 | empty_dict_annotated_str_keys["x"] = 1
51 | for k, v in empty_dict_annotated_str_keys:
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 |     pass
   |
help: Add a call to `.items()`
   |
50 | empty_dict_annotated_str_keys["x"] = 1
   - for k, v in empty_dict_annotated_str_keys:
51 + for k, v in empty_dict_annotated_str_keys.items():
52 |     pass
   |
note: This is an unsafe fix and may change runtime behavior
