spekk.trees.registry.register_dispatch_fn#
- spekk.trees.registry.register_dispatch_fn(dispatch_fn: Callable[[Mapping[Any, Mapping[Any, Tree] | Sequence[Tree] | Any] | Sequence[Mapping[Any, Tree] | Sequence[Tree] | Any] | Any], TreeDef | None])[source]#
Register a new
TreeDefby dispatch function.Multiple dispatch functions may be registered, in which case they will be tried in order until one of them returns a
TreeDef. Note thatdispatch_by_type()anddispatch_treedef()always comes first and takes precendence.