treescope.repr_lib

treescope.repr_lib#

Stable high-level interface for building object reprs.

These functions simplify the process of implementing __treescope_repr__ for custom types, allowing them to integrate with treescope. This interface will be stable across treescope releases, and may be expanded in the future to support additional customization.

Functions

handle_custom_listlike(node, path, ...[, ...])

Handler for custom list-like sequences.

handle_custom_mapping(node, path, ...[, ...])

Handler for custom mappings.

render_dictionary_wrapper(object_type, ...)

Renders an object in "wrapped dictionary format".

render_enumlike_item(object_type, item_name, ...)

Renders a value of an enum-like type (e.g. like enum.Enum).

render_list_wrapper(object_type, ...[, ...])

Renders an object in "wrapped list format".

render_object_constructor(object_type, ...)

Renders an object in "constructor format", similar to a dataclass.