Skip to content

Commit 229fddb

Browse files
GCI103 DictionaryItemsUnused slight improve in documentation
Co-authored-by: DataLabGroupe-CreditAgricole <[email protected]>
1 parent b6c115b commit 229fddb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/rules/GCI103/python/GCI103.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ These results show that even at the micro-optimization level, more efficient cod
6565

6666
== Conclusion
6767

68+
Unlike .items(), which creates a (key, value) tuple for each entry, .keys() and .values() access only what's needed without tuple allocation, making them more efficient.
69+
6870
Using `.keys()` or `.values()` instead of `.items()` when you only need one part of the dictionary:
6971

7072
- Improves code clarity and intent
@@ -75,4 +77,4 @@ Using `.keys()` or `.values()` instead of `.items()` when you only need one part
7577
== References
7678

7779
- Python dict documentation: https://docs.python.org/3/library/stdtypes.html#dict
78-
80+
- Python .items() method: https://www.w3schools.com/python/ref_dictionary_items.asp

0 commit comments

Comments
 (0)