![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| None | __init__ (self, HookFactory[Hook] fallback_factory, BaseConverter converter) |
| Hook | dispatch_without_caching (self, TargetType typ) |
| None | register_cls_list (self, cls_and_handler, bool direct=False) |
| register_func_list (self, list[tuple[Predicate, Any]|tuple[Predicate, Any, bool]|tuple[Predicate, Callable[[Any, BaseConverter], Any], Literal["extended"]]] pred_and_handler) | |
| None | clear_direct (self) |
| None | clear_cache (self) |
| int | get_num_fns (self) |
| None | copy_to (self, MultiStrategyDispatch other, int skip=0) |
Public Attributes | |
| dispatch | |
Static Public Attributes | |
| Callable | dispatch [[TargetType, BaseConverter], Hook] |
Protected Attributes | |
| _fallback_factory | |
| _direct_dispatch | |
| _function_dispatch | |
| _single_dispatch | |
Static Protected Attributes | |
| HookFactory | _fallback_factory [Hook] |
| BaseConverter | _converter |
| dict | _direct_dispatch [TargetType, Hook] |
| FunctionDispatch | _function_dispatch |
| Any | _single_dispatch |
MultiStrategyDispatch uses a combination of exact-match dispatch,
singledispatch, and FunctionDispatch.
:param converter: A converter to be used for factories that require converters.
:param fallback_factory: A hook factory to be called when a hook cannot be
produced.
.. versionchanged:: 23.2.0
Fallbacks are now factories.
.. versionchanged:: 24.1.0
Support for factories that require converters, hence this requires a
converter when creating.
| None cattrs.dispatch.MultiStrategyDispatch.clear_cache | ( | self | ) |
Clear all caches.
| None cattrs.dispatch.MultiStrategyDispatch.clear_direct | ( | self | ) |
Clear the direct dispatch.
| Hook cattrs.dispatch.MultiStrategyDispatch.dispatch_without_caching | ( | self, | |
| TargetType | typ | ||
| ) |
Dispatch on the type but without caching the result.
| None cattrs.dispatch.MultiStrategyDispatch.register_cls_list | ( | self, | |
| cls_and_handler, | |||
| bool | direct = False |
||
| ) |
Register a class to direct or singledispatch.
| cattrs.dispatch.MultiStrategyDispatch.register_func_list | ( | self, | |
| list[ tuple[Predicate, Any] | tuple[Predicate, Any, bool] | tuple[Predicate, Callable[[Any, BaseConverter], Any], Literal["extended"]] ] | pred_and_handler | ||
| ) |
Register a predicate function to determine if the handler
should be used for the type.
:param pred_and_handler: The list of predicates and their associated
handlers. If a handler is registered in `extended` mode, it's a
factory that requires a converter.