Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
cattrs.dispatch.MultiStrategyDispatch Class Reference
Inheritance diagram for cattrs.dispatch.MultiStrategyDispatch:
Inheritance graph
[legend]
Collaboration diagram for cattrs.dispatch.MultiStrategyDispatch:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Member Function Documentation

◆ clear_cache()

None cattrs.dispatch.MultiStrategyDispatch.clear_cache (   self)
Clear all caches.

◆ clear_direct()

None cattrs.dispatch.MultiStrategyDispatch.clear_direct (   self)
Clear the direct dispatch.

◆ dispatch_without_caching()

Hook cattrs.dispatch.MultiStrategyDispatch.dispatch_without_caching (   self,
TargetType  typ 
)
Dispatch on the type but without caching the result.

◆ register_cls_list()

None cattrs.dispatch.MultiStrategyDispatch.register_cls_list (   self,
  cls_and_handler,
bool   direct = False 
)
Register a class to direct or singledispatch.

◆ register_func_list()

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.

The documentation for this class was generated from the following file: