Specialize Your Own Collection in Python
Mapping, Sequence or Collection in Python: you choose the best one for the data structure you want to build. A simple explanation of everything you need.
Code
Inside articles there are more settings: width, font size, series position and code.
Saved in this browser.
Mapping, Sequence or Collection in Python: you choose the best one for the data structure you want to build. A simple explanation of everything you need.
In Python Views, if you change something in the underlying dictionary (a value or a key), the change is reflected inside the Views. Learn how they work.
A hashable is any object that returns its "Hash Code" when asked, and that code stays the same for the whole life of the object. Learn how it works in Python.
Learn whether a variable can change (mutable) or not (immutable). Mutable: List, Dict, Set. Immutable: String, Int, Float, Bool, Tuple, Range, Decimal.
Learn how to build your own Collection in Python step by step: Container, Sized and Iterable explained, plus the difference between an Iterator and an Iterable.
Learn how to build a data stream by balancing memory use and processing time: buffer data for a steady flow, generate data on demand, and cache results.