View source on GitHub |
Class decorator that fills in missing ordering methods from __cmp__
.
google.appengine.api.cmp_compat.total_ordering_from_cmp(
cls
)
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__
.
Args | |
---|---|
cls
|
The class to decorate. |
Returns | |
---|---|
The decorated class. |