Provides a way to wrap multiple interrelated functions, while preserving uniqueness.
author: | Christopher O’Brien <obriencj@gmail.com> |
---|---|
license: | LGPL v.3 |
Mapping supporting automatic brining of contained values when pickled. Provides the dict interface special methods.
Accepts a single optional positional argument, which must be a dict or an iterable of key,value pairs. Also accepts an arbutrary number of named parameters which will be used to create further mappings.
Clears the internal cache. Any future sets or gets from this Barrel will cause full brining or unbrining rather than returning an already computed value.
If you retrieved a value from this barrel and want to load a new copy (possibly with different globals), calling reset() is a way to achieve such.
Abstract base class for barrel wrappers. Defines the interface required for a barrel to brine a value.
Utility method for implementations to request that the parent barrel brine an internal value. This allows the barrel to act as a cache of the brining process.
Utility method for implementations to request that the parent barrel unbrine an internal value. This allows the barrel to act as a cache of the unbrining process.
Recreate a copy of the initial brined value
Parameters: | with_globals : globals() or dict-like
|
---|---|
Returns: | value : object
|
Bases: brine.barrel.BarreledObject, brine.BrinedFunction
A brined function in a barrel. This wrapper is created automatically around function instances in a Barrel when it is pickled.
Bases: brine.barrel.BarreledObject, brine.BrinedMethod
A brined bound method in a barrel. This wrapper is created automatically around instancemethod instances in a Barrel when it is pickled.
Bases: brine.barrel.BarreledObject, brine.BrinedPartial
A brined partial in a barrel. This wrapper is created automatically around partial instances in a Barrel when it is pickled.