language.configurable
def configurable(target: typing.Any = None, strict: bool = True) -> typing.AnyMark a callable as a configuration boundary for :func:`trace`.
**Outside a trace** the decorated callable executes normally — it is a
transparent pass-through. **Inside a trace** it intercepts the call,
converts positional arguments to named ones via
:func:`inspect.Signature.bind` + :meth:`~inspect.BoundArguments.apply_defaults`,
and emits an equivalent ``L.call`` node without running the target body.
Usage as a bare decorator::
@L.configurable
class Encoder:
def __init__(self, depth: int): ...
Usage as a factory (pass options)::
@L.configurable(strict=False)
class Encoder:
def __init__(self, depth: int): ...
Parameters
| Name | Type | Description |
|---|---|---|
| target = None | callable | When used as ``@L.configurable`` (no parentheses), the wrapped callable is passed here. When used as ``@L.configurable(…)``, ``target`` is ``None`` and a decorator factory is returned. |
| strict = ``True`` | bool | Forwarded to the underlying :func:`call` during tracing. When ``True``, unknown kwargs are validated against the target's signature at config-construction time. This knob is independent of the :func:`trace` ``strict`` flag, which governs the root-value check. |
Source: laco/language.py:1085