Key 3: Using third-party data structures.
Python has a good bunch of data structures in the core language/library. But sometimes, an application has very specific requirements. We can always use third-party data-structure packages. Most of such modules are Python wrapper over C, C++ implementations:
blistmodule provides a drop-in replacement for list,
sortedset. It is discussed in greater detail in later chapters.
bintreesmodule provides binary, AVL tree, and Red-Black trees.
banyanmodule provides Red-Black trees, splay tree, and sorted lists.
SortedSet. So, one can get almost every data structure for Python easily. More stress ...