Danger Zone: Mixing Mutable and Immutable Data Structures
In this lesson, you’ll see that using a combination of mutable and immutable data structures can still lead to problems. Even if you use an immutable data structure like
namedtuple, you still run the risk of modifying your data set if you store your immutable data structures in mutables ones, like lists.
In the next lesson, you’ll see how to address this problem by replacing the rest of your mutables data structures with immutable ones.
Comments & Discussion
Become a Member to join the conversation.