A port of mathdom from Python 2 to Python 3.