\ :py:mod:`clipppy.stochastic.wrapper` ====================================== .. py:module:: clipppy.stochastic.wrapper Module Contents --------------- .. py:data:: _T .. py:data:: _cls .. py:class:: CallableWrapper(obj, /, *args, **kwargs) Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: __slots__ :annotation: = _call__ .. py:method:: __call__(self, *args, **kwargs) :abstractmethod: .. py:method:: __getattribute__(self, item) Return getattr(self, name). .. py:class:: FunctionWrapper(func: types.FunctionType) def functions and lambdas in python are special... .. py:method:: __call__(self, *args, **kwargs) .. py:class:: Wrapper(*args, **kwargs) Maps non-wrapped types to wrapped with specific Wrapped subtype .. py:attribute:: __slots__ :annotation: = ['_wrapped_obj', '_call__'] .. py:attribute:: _wrapped_registry :annotation: :ClassVar[MutableMapping[Type[_T], Type[Wrapper[_T]]]] .. py:method:: __class_getitem__(cls, item: Type) :classmethod: .. py:method:: __getstate__(self) .. py:method:: __init_subclass__(cls, final=False, **kwargs) :classmethod: .. py:method:: __reduce__(self) Helper for pickle. .. py:method:: __setstate__(self, state)