def render_struct_constructor(
    node: struct.Struct,
) -> rendering_parts.RenderableTreePart:
  """Renders the constructor of a Struct, with an open parenthesis."""
  if dataclass_util.init_takes_fields(type(node)):
    return rendering_parts.siblings(
        rendering_parts.maybe_qualified_type_name(type(node)), "("
    )
  else:
    return rendering_parts.siblings(
        rendering_parts.maybe_qualified_type_name(type(node)),
        rendering_parts.roundtrip_condition(
            roundtrip=rendering_parts.text(".from_attributes")
        ),
        "(",
    )
Renders the constructor of a Struct, with an open parenthesis.
penzai/core/_treescope_handlers/struct_handler.py