Skip to content

Commit 5f8067d

Browse files
author
Antoine Rozo
committed
Fix explanation for 6th example of "Needles in a Haystack"
1 parent 83cac75 commit 5f8067d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2579,7 +2579,7 @@ def similar_recursive_func(a):
25792579
25802580
* As for the fifth snippet, most methods that modify the items of sequence/mapping objects like `list.append`, `dict.update`, `list.sort`, etc. modify the objects in-place and return `None`. The rationale behind this is to improve performance by avoiding making a copy of the object if the operation can be done in-place (Referred from [here](http://docs.python.org/2/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list)).
25812581
2582-
* Last one should be fairly obvious, passing mutable object (like `list` ) results in a call by reference, whereas an immutable object (like `int`) results in a call by value.
2582+
* Last one should be fairly obvious, mutable object (like `list`) can be altered in the function, and the reassignation of an immutable (`a -= 1`) is not an alteration of the value.
25832583
25842584
* Being aware of these nitpicks can save you hours of debugging effort in the long run.
25852585

0 commit comments

Comments
 (0)