mindly.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mindly.Social is an English speaking, friendly Mastodon instance created for people who want to use their brains and their hearts to make social networking more social. 🧠💖

Administered by:

Server stats:

1.2K
active users

#mutability

0 posts0 participants0 posts today
Replied in thread

@matt

Oh, and sets too.

Example with shallow list copy and an embedded mutable object (another list):

>>> a = [1, 2, [3, 4]]
>>> b = a.copy()

>>> b
[1, 2, [3, 4]]
>>> b[0] = 5
>>> b
[5, 2, [3, 4]]

>>> a
[1, 2, [3, 4]]

>>> b[2][0] = 8
>>> a
[1, 2, [8, 4]]
>>> b
[5, 2, [8, 4]]