Comparable interface
In Java, a promise that a class has a compareTo(other) method returning negative, zero or positive, so its objects have a natural order.
natural ordering
The default order of a type, used by sorted() with no key (numbers by size, strings by code point, a comparable class by its own rule).
rich comparison methods
Python's special methods __lt__, __le__, __eq__, __ne__, __gt__, __ge__ that define <, <=, ==, !=, >, >= for a class.
`@total_ordering`
A decorator from functools that builds the remaining comparison methods from __eq__ and one of __lt__, __le__, __gt__ or __ge__.
Comparator
A separate object or function that defines an ordering from outside a class (Java Comparator; Python key or cmp_to_key).
total order
An ordering in which any two items can be compared and the rules (irreflexive, antisymmetric, transitive) always hold.
`NotImplemented`
A special value a comparison method returns when it cannot compare with the other object's type, so Python can try something else or raise TypeError.