this post was submitted on 25 Sep 2026
58 points (91.4% liked)

Python

8062 readers
1 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 3 years ago
MODERATORS
 

A hard exercise to help build the right mental model for Python data.

The โ€œSolutionโ€ link visualizes execution and reveals whatโ€™s actually happening using ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜†_๐—ด๐—ฟ๐—ฎ๐—ฝ๐—ต: https://github.com/bterwijn/memory_graph

you are viewing a single comment's thread
view the rest of the comments
[โ€“] apparia@discuss.tchncs.de 6 points 1 week ago (1 children)

Nice puzzle and tool. I picked the right answer but I wasn't overly confident.

You could list {1: [100]} as another possible answer, if you assume:

spoilerb |= {...} is equivalent to b = b | {...}, but you also realise the lists are never deep-cloned.

[โ€“] bterwijn@programming.dev 4 points 1 week ago

Thanks, maybe I should have added that possible answer instead of 'D', adding one more feels too many.