class documentation

class ReprStrMixin:

View In Hierarchy

Mixin providing default __repr__ and __str__ implementations.

Classes contribute representation items by overriding _repr_items(). Subclasses should call super()._repr_items() and yield additional (name, value) pairs.

Method __repr__ Return an unambiguous representation of the instance.
Method __str__ Return a human-readable representation of the instance.
Method _repr_items Yield (name, value) pairs for the string/repr representation.
@override
def __repr__(self) -> str:

Return an unambiguous representation of the instance.

@override
def __str__(self) -> str:

Return a human-readable representation of the instance.

def _repr_items(self) -> Iterator[tuple[str, object]]:

Yield (name, value) pairs for the string/repr representation.