Python lists remember what you did to them

Two Python lists of the same size can take different amounts of memory, even if they contain exactly the same elements. A larger list can even take less memory than a smaller list. How can this be? Lists appear to remember more than just their elements, and somehow contain some information of their history. In this video we investigate this phenomenon. We see what the system getsizeof function returns and how the internal structure of a list is represented in order to find the answer. ― mCoding with James Murphy () Source code: libcst: AST linting vid: Structural pattern matching vid: SUPPORT ME ⭐ --------------------------------------------------- Sign up on Patreon to get your donor role and early access to videos! Feeling generous but don’t have a Patreon? Donate via PayPal! (No sign up needed.) https://
Back to Top