Skip to content
Snippets Groups Projects
structures.rst 5.75 KiB

Structures

SparseMatrix

Heaps

Heap

This essentially allows you to have a heap object that will pretty much behave like the heapq library.

SetHeap

A heap with additional invariant that no two elements on the heap are the same. This is optimized for fast pushes() and membership checks.

TimeBasedHeap

Time-based heap is a good structure if you have many callbacks set to fire at a particular time in the future. It functions very like a normal Heap.

TimeBasedSetHeap

A combination of TimeBasedHeap and SetHeap:

Mixins

Mixins are classes whose constructor you do not need to invoke. They magically endow your class with chosen properties, often by overloading their specific special methods.

ComparableAndHashableByInt

OmniHashableMixin

If you need quick __hash__ and __eq__ operators from listed fields of the class.

ComparableAndHashableBy

StrEqHashableMixin

A class that outfits your class with __eq__ and __hash__ based off the str() value of the class. So you got to define __str__ at the very least!