siblings_with_annotations

siblings_with_annotations#

penzai.treescope.foldable_representation.basic_parts.siblings_with_annotations(*args: str | RenderableTreePart | RenderableAndLineAnnotations, extra_annotations: Sequence[RenderableTreePart] = ()) RenderableAndLineAnnotations[source]#

Combines siblings that may have annotations, aggregating separately.

This can be used to lay out multiple objects on the same line, when some may have annotations.

Parameters:
  • *args – Sequence of strings, renderable tree parts, or commented tree parts to render.

  • extra_annotations – Additional annotations to add.

Returns:

A new pair of renderable and annotations, with main renderables and annotations combined separately.