NotRoundtrippable#

class penzai.treescope.copypaste_fallback.NotRoundtrippable[source]#

Bases: object

A placeholder for a non-roundtrippable object in roundtrip mode.

Many objects can be round-trippably rendered by Treescope, but some do not support full round-tripping (e.g. JAX arrays or unrecognized PyTree leaves). For these objects, it is still sometimes convenient to render something that is valid Python and identifies the original object. This placeholder object serves that purpose.

Variables:
  • original_repr (str) – The raw repr of the object.

  • original_id (int) – The ID of the original object.

  • original_type (type[Any]) – The type of the original object.

Methods

__init__(original_repr, original_id, ...)

from_object(obj[, repr_override])

Constructs a NotRoundtrippable from an object.

Attributes

original_repr

original_id

original_type

classmethod from_object(obj: Any, repr_override: str | None = None) NotRoundtrippable[source]#

Constructs a NotRoundtrippable from an object.