def __repr__(self):
    """Renders this object with treescope, on a single line."""
    # Defer to Treescope.
    import treescope  # pylint: disable=import-outside-toplevel

    with treescope.using_expansion_strategy(max_height=1):
      return treescope.render_to_text(self, ignore_exceptions=True)
Renders this object with treescope, on a single line.
penzai/core/struct.py