Skip to main content

๐ŸŽฎ Python Internals (Practice)

Companion to the Python Internals & NumPy Memory guide. See how Python object identity and mutability actually behave. Edit and run the code right here โ€” it executes in your browser.

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Show that list * on nested lists shares references (the classic gotcha).
  2. Use sys.getsizeof to compare a list vs a generator.
  3. Why does NumPy's contiguous memory make vectorized ops fast?

Continue the learning path โ†’ Recursion And Call Stack