Designing With Immutability
summary
Immutable collections enable concrete benefits: safe sharing, cheap caching, thread safety, and correct dictionary/set behavior rather than vague design advice. Examples and tools are concrete — mappingproxy is only a proxy and not hashable, immutables Map (HAMT) gives persistent maps with cheap copies and high memory density, and frozen dataclasses / attrs produce hashable records when their contents are hashable. Beware of making mutable objects hashable: it breaks set/dict invariants. A real project (HDB) uses immutables successfully.
AI-written summary · about
chapters (8)
- 0:00Start
- 0:46Agenda
- 1:16Python Is Mutable
- 2:39Mutable Lists
- 5:52Hashing
- 10:09Conclusion
- 13:42Advantages of Immutable Data Structures
- 28:53Python Language Summit
related talks
01h 03mRefactoring to Immutability
10mFunctional Programming for Everyone
19mImmutability is Changing: From Immutable.js to Immer
12mThey're functional! They're efficient!!
46mImmutability Against The Machine
31mImmer, Immutability and the Wonderful World of Proxies
34mImmutability: Putting The Dream Machine To Work
30mOvercoming GIL with subinterpreters and immutability
