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

lt

param right:

RHS of < comparison

returns:

self < right

__ge__(right: Self) → bool

ge

param right:

RHS of >= comparison

returns:

self >= right

__gt__(right: Self) → bool

gt

param right:

RHS of > comparison

returns:

self > right