Skip to content

treex.Repr

Mixin that adds a __repr__ method to the class.

__repr__(self) special

Uses treeo.to_string to generate a string representation of the object.

Source code in treeo/mixins.py
def __repr__(self) -> tp.Any:
    """
    Uses `treeo.to_string` to generate a string representation of the object.
    """
    return api.to_string(
        self,
        private_fields=False,
        static_fields=True,
        color=False,
    )