protocols.orderings¶
Protocols for orderings of algebraic structures.
- class boring_math.abstract_algebra.protocols.orderings.PartialOrder(*args, **kwargs)¶
Partially Ordered.
Important
Contract: Operator
<=is reflexive, anti-symmetric and transitive.- __le__(other: Self) bool¶
Return self<=value.
- __init__(*args, **kwargs)¶
- classmethod __subclasshook__(other)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __weakref__¶
list of weak references to the object
- class boring_math.abstract_algebra.protocols.orderings.TotalOrder(*args, **kwargs)¶
Totally Ordered.
Important
Contract: Overloaded methods must still define a total order.
- __lt__(other: Self) bool¶
Return self<value.
- __ge__(other: Self) bool¶
Return self>=value.
- __gt__(other: Self) bool¶
Return self>value.
- classmethod __subclasshook__(other)¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).