You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Penzai's pretty printer Treescope can now be more easily extended to work with custom types, by defining the special method __penzai_repr__, which will be detected during pretty-printing. Renderings of these custom types can be built using penzai.treescope.repr_lib, a stable extension API that can be used to implement __penzai_repr__ in a forwards-compatible way. (Note that the exact internal representation of Treescope renderings is still unstable and may change in the future; see the documentation for penzai.treescope for details.)
Added pz.ts.basic_interactive_setup(), which simplifies setting up the pretty-printer in an IPython notebook.
Bug fixes and improvements:
Improved detection of mutable vs immutable objects during pretty-printing.
Fixed detection of special methods _repr_html_ and __penzai_repr__ to avoid objects that generate arbitrary attributes dynamically.
Copy-path buttons are no longer shown for the root node.
Documentation changes:
Documentation has been added for how to extend penzai.treescope to render custom types in a stable way.
The right-hand sidebar now shows more detail in tutorial notebooks.