struct_attr_style_fn_for_fields

struct_attr_style_fn_for_fields#

penzai.treescope.handlers.penzai.struct_handler.struct_attr_style_fn_for_fields(fields) Callable[[str], part_interface.RenderableTreePart][source]#

Builds a function to render attributes of a struct.

The resulting function will render pytree node fields in a different style.

Parameters:

fields – The fields of the struct.

Returns:

A function that takes a field name and returns a RenderableTreePart for the attribute rendering.