Python Collections

Python Collections - Special Container Types Cover Image

Python collections Module: Special Container Types

The Python collections module builds on many of the container data types available in Python. By providing efficient and intuitive classes and functions, the collections module extends the many different Python data types. While lists, dictionaries, and strings are highly customizable, the collections module is meant to enhance these data types. By diving into the […]

Python collections Module: Special Container Types Read More »

Python UserString - Custom Python Strings with collections Cover Image

Python UserString – Custom Python Strings with collections

Building custom strings allows you to define powerful programs. You can easily build new strings that have custom behavior or new functionalities, which build on top of regular Python strings. In this tutorial, you’ll learn how to use the Python collections UserDict class to create custom dictionaries. You’ll also learn how to build your own

Python UserString – Custom Python Strings with collections Read More »

Python UserList - Custom Python Lists with collections Cover Image

Python UserList – Custom Python Lists with collections

Building custom lists allows you to define powerful programs, by extending on the functionality of normal Python lists. You can easily build new lists that have custom behavior or new functionalities, which build on top of regular Python lists. In this tutorial, you’ll learn how to use the Python collections UserList class to create custom

Python UserList – Custom Python Lists with collections Read More »

Python UserDict - Custom Python Dictionaries with collections Cover Image

Python UserDict – Custom Python Dictionaries with collections

Building custom dictionaries allows you to define powerful programs. You can easily build new dictionaries that have custom behavior or new functionalities, which build on top of regular Python dictionaries. In this tutorial, you’ll learn how to use the Python collections UserDict class to create custom dictionaries. You’ll also learn how to build your own

Python UserDict – Custom Python Dictionaries with collections Read More »

Collections ChainMaps in Python Complete Guide Cover Image

Collections ChainMaps in Python: Complete Guide

The Python collections module provides Python’s implementations of chain maps with the ChainMaps class. This allows you to implement multiple dictionaries in the same context. This means that you can maintain multiple dictionaries, but access them as though they were a single dictionary. In this tutorial, you’ll learn how to use the ChainMap class from

Collections ChainMaps in Python: Complete Guide Read More »

Python Collections OrderedDict - Adding Order to Dictionaries Cover Image

Python Collections OrderedDict: Adding Order to Dictionaries

Python OrderedDicts are dictionary subclasses that maintain the order of the items added to them. Since Python 3.6, dictionaries in Python have maintained order. So this begs the question, why do we still need the OrderedDict class from the Python collections module? By the end of this tutorial, you’ll have gained a strong understanding of

Python Collections OrderedDict: Adding Order to Dictionaries Read More »