From be2d537a05346c15a2761bc2fa0b0397b4ad3a92 Mon Sep 17 00:00:00 2001 From: Vladislav Glinsky Date: Thu, 17 Sep 2020 03:38:41 +0300 Subject: [PATCH] Add link to Python FAQ to "Mutating the immutable" --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b2f05d8..9f30a41 100644 --- a/README.md +++ b/README.md @@ -1701,6 +1701,7 @@ But I thought tuples were immutable... An object of an immutable sequence type cannot change once it is created. (If the object contains references to other objects, these other objects may be mutable and may be modified; however, the collection of objects directly referenced by an immutable object cannot change.) * `+=` operator changes the list in-place. The item assignment doesn't work, but when the exception occurs, the item has already been changed in place. +* There's also an explanation in [official Python FAQ](https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works). ---