freeze_in_dev

function
yoltra/immutability.py:194
signature
freeze_in_dev(value): any

Wrap a value read-only in development; pass it through in production. Only `dict` and `list` are proxied (the blessed fast-path containers); everything else — primitives, tuples, sets, dataclasses — is returned as-is. Wrapping is idempotent and lazy: nested containers are wrapped on access, so no copy of the underlying tree is made.

Parameters

NameTypeDescription
valueanyAny value.

Returns

anyIn production, `value` unchanged. In development, a `ReadOnlyDict` or `ReadOnlyList` view for dicts/lists, otherwise `value`.