Skip to content

treex.Repr

Mixin that adds a __repr__ method to the class.

Source code in treeo/mixins.py
class Repr:
    """
    Mixin that adds a `__repr__` method to the class.
    """

    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,
        )

__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,
    )