ChildAutovisualizer

ChildAutovisualizer#

class penzai.treescope.autovisualize.ChildAutovisualizer[source]#

Bases: object

Used by autovisualizers to switch to a different autovisualizer.

This can be used to enable conditional logic, e.g. “when rendering an object of type Foo, visualize objects of type Bar”. Note that the returned child autovisualizer is also allowed to close over things from the current call, e.g. you can return a lambda function that checks if it is rendering a particular child of the original node.

Variables:

autovisualizer (Autovisualizer) – The new autovisualizer to use while rendering this value’s children.

Methods

__init__(autovisualizer)

Attributes

autovisualizer