Skip to content

Commit fe21d30

Browse files
committed
Merge pull request quantifiedcode#20 from gvx/patch-8
Don't assign to builtins
2 parents 643c0b9 + 4148de4 commit fe21d30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/correctness/not_using_setdefault_to_initialize_a_dictionary.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ The modified code below uses ``setdefault()`` to initialize the dictionary. When
3131
3232
dictionary = {}
3333
34-
list = dictionary.setdefault("list", [])
35-
36-
list.append("list_item")
34+
dictionary.setdefault("list", []).append("list_item")
3735
3836
References
3937
----------

0 commit comments

Comments
 (0)