This lets us take a class defined for Python 2's ordering system (using
__cmp__) and use it with minimal changes — just a decorator — in Python 3.
This implementation is adapted from the Python 2 version of
functools.total_ordering, which derives these methods from each other
instead of from __cmp__.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["This class decorator, `total_ordering_from_cmp`, adds missing ordering methods to a class using the `__cmp__` method."],["It allows classes designed for Python 2's ordering to be adapted for Python 3 with minimal changes, specifically through the use of this decorator."],["The decorator takes one argument, which is the class to apply the ordering methods."],["The primary function of this decorator is to ensure Python 3 ordering compatibility for classes initially designed for Python 2's `__cmp__`-based comparison."]]],[]]