IMMUTABLE_TYPES_REGISTRY#
- treescope.type_registries.IMMUTABLE_TYPES_REGISTRY: dict[type[Any], bool]#
Global registry of non-hashable types that are considered immutable.
By default, treescope will detect repeated values of any non-hashable type and render a warning that they are shared across different parts of the tree. This is intended to help catch bugs in which a value is accidentally shared between different parts of a tree, which could cause problems when the tree is mutated.
Some types are not hashable, but are still immutable. For instance,
jax.Array
is immutable and can be safely shared. This set is used to suppress the “shared value” warning for these types.