class documentation

class Semigroup(Protocol[T]):

View In Hierarchy

A type with an associative binary operator.

Common examples of a semigroup are integers with addition and strings with concatenation.

Method __add__ This must be associative: a + (b + c) == (a + b) + c
def __add__(self, other: T) -> T: ΒΆ

This must be associative: a + (b + c) == (a + b) + c