A hard exercise to help build the right mental model for Python data.
- Solution: https://memory-graph.com/#codeurl=https%3A%2F%2Fraw.githubusercontent.com%2Fbterwijn%2Fmemory_graph_videos%2Frefs%2Fheads%2Fmain%2Fexercises%2Fexercise26.py&play=
- Explanation: https://github.com/...
The โSolutionโ link visualizes execution and reveals whatโs actually happening using ๐บ๐ฒ๐บ๐ผ๐ฟ๐_๐ด๐ฟ๐ฎ๐ฝ๐ต: https://github.com/bterwijn/memory_graph


The
|and|=operators fordictwere added in 3.9 which was released in 2020, so it's a relatively recent feature.I like having an operator for set union but I don't like that
a |= bhas different semantics toa = a|b. This violates the principle of least surprise, since the former is supposed to be a shorthand for the latter.save