Why cpython exposes 'PyTuple_SetItem' as C-API if tuple is immutable by design?
Why cpython exposes 'PyTuple_SetItem' as C-API if tuple is immutable by design? Question: Tuple in python is immutable by design, so if we try to mutate a tuple object python emits following TypeError which make sense. >>> a = (1, 2, 3) >>> a[0] = 12 Traceback (most recent call last): File "<stdin>", line 1, …