orderings

Orderings on Algebras

Protocols for orderings of algebraic structures.

Total and partial orderings on algebras.

class boring_math.abstract_algebra.properties.orderings.PartialOrder

Bases: Protocol, Generic

Partially Ordered.

Important

Contract: Operator <= is reflexive, anti-symmetric and transitive.

__le__(right: Self) bool
Parameters:

right – RHS of <= comparison

Returns:

self <= right

class boring_math.abstract_algebra.properties.orderings.TotalOrder

Bases: PartialOrder, Protocol, Generic

Totally Ordered.

Important

Contract: Overloaded methods must still define a total order.

__lt__(right: Self) bool
Parameters:

right – RHS of < comparison

Returns:

self < right

__ge__(right: Self) bool
Parameters:

right – RHS of >= comparison

Returns:

self >= right

__gt__(right: Self) bool
Parameters:

right – RHS of > comparison

Returns:

self > right

__le__(right: Self) bool
Parameters:

right – RHS of <= comparison

Returns:

self <= right