clipppy.stochastic.capsule¶
Module Contents¶
- class clipppy.stochastic.capsule.AllEncapsulator(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__ = ['capsule', 'capsule_args', 'capsule_kwargs']¶
- __call__(self, *args, **kwargs)¶
- class clipppy.stochastic.capsule.Capsule(lifetime: numbers.Real = 1)¶
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__ = ['_value', 'lifetime', 'remaining']¶
- _value :Union[weakref.ReferenceType[clipppy.stochastic.wrapper._T], clipppy.stochastic.wrapper._T]¶
- __call__(self)¶
- __repr__(self)¶
Return repr(self).
- classmethod init(cls, value, lifetime: numbers.Real = 1)¶
- property value(self) clipppy.stochastic.wrapper._T¶
- class clipppy.stochastic.capsule.Encapsulator(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