DEV Community

Aleksei Aleinikov
Aleksei Aleinikov

Posted on

๐Ÿ Inside CPython 2025: What You Never Knew About Tuples

โœ… Why len(t) is always instant (O(1))
โ™ป๏ธ How small tuples reuse memory through freelists
โš ๏ธ Hidden mutability in C extensions (and how to demo it in Python)
๐Ÿ” Plans for making tuples truly immutable in the future
๐Ÿ‘‰ Read this to understand Pythonโ€™s internals like a pro!
https://medium.com/pythoneers/inside-cpython-2025-the-truth-about-tuples-memory-re-use-and-hidden-mutability-0dc53150c956

Top comments (0)