Skip to content

Semigroup

Semigroup

Bases: Protocol[T]

A type is a Semigroup if it implements the add method.

Source code in funclift/semigroup.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Semigroup(Protocol[T]):
    """A type is a Semigroup if it implements the __add__ method."""

    def __add__(self: Semigroup[T], other: Semigroup[T]) -> Semigroup[T]:
        """_summary_

        Args:
            self (T): _description_
            other (T): _description_

        Returns:
            T: _description_
        """
        ...

__add__(other)

summary

Parameters:

Name Type Description Default
self T

description

required
other T

description

required

Returns:

Name Type Description
T Semigroup[T]

description

Source code in funclift/semigroup.py
13
14
15
16
17
18
19
20
21
22
23
def __add__(self: Semigroup[T], other: Semigroup[T]) -> Semigroup[T]:
    """_summary_

    Args:
        self (T): _description_
        other (T): _description_

    Returns:
        T: _description_
    """
    ...