clipppy.stochastic.wrapper¶
Module Contents¶
- clipppy.stochastic.wrapper._T¶
- clipppy.stochastic.wrapper._cls¶
- class clipppy.stochastic.wrapper.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
- __slots__ = _call__¶
- abstract __call__(self, *args, **kwargs)¶
- __getattribute__(self, item)¶
Return getattr(self, name).
- class clipppy.stochastic.wrapper.FunctionWrapper(func: types.FunctionType)¶
def functions and lambdas in python are special…
- __call__(self, *args, **kwargs)¶
- class clipppy.stochastic.wrapper.Wrapper(*args, **kwargs)¶
Maps non-wrapped types to wrapped with specific Wrapped subtype
- __slots__ = ['_wrapped_obj', '_call__']¶
- _wrapped_registry :ClassVar[MutableMapping[Type[_T], Type[Wrapper[_T]]]]¶
- classmethod __class_getitem__(cls, item: Type)¶
- __getstate__(self)¶
- classmethod __init_subclass__(cls, final=False, **kwargs)¶
- __reduce__(self)¶
Helper for pickle.
- __setstate__(self, state)¶