#mutability — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #mutability, aggregated by home.social.
-
Concurrency, interactivity, mutability, choose two
https://www.n16f.net/blog/concurrency-interactivity-mutability-choose-two/
Comments: https://news.ycombinator.com/item?id=49065874
#HackerNews #Concurrency #interactivity #mutability #programming #blog
-
Concurrency, interactivity, mutability, choose two
https://www.n16f.net/blog/concurrency-interactivity-mutability-choose-two/
Comments: https://news.ycombinator.com/item?id=49065874
#HackerNews #Concurrency #interactivity #mutability #programming #blog
-
An exercise to help build the right mental model for Python data.
- Solution: https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph_videos/refs/heads/main/exercises/exercise18.py&play
- Explanation: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#python-data-modelThe “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: https://github.com/bterwijn/memory_graph#readme
-
An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
- Solution: https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph_videos/refs/heads/main/exercises/exercise7.py&play
- Explanation: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#python-data-model -
An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:
- Solution: https://memory-graph.com/#codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph_videos/refs/heads/main/exercises/exercise7.py&play
- Explanation: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#python-data-model -
As much as I value data integrity, I also appreciate data mutability. I’ve never understood the crowd that insists there's only one best solution.
-
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]] -
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]]