treevalue.tree.common¶
TreeStorage¶
-
class
treevalue.tree.common.TreeStorage¶
raw¶
-
treevalue.tree.common.raw(obj)¶ - Overview:
Try wrap the given
objto raw wrapper.- Arguments:
obj (
object): The original object.
- Returns:
wrapped (
object): Wrapped object, if the type is not necessary to be wrapped, the original object will be returned here.
unraw¶
-
treevalue.tree.common.unraw(wrapped)¶ - Overview:
Try unwrap the given
wrappedto original object.- Arguments:
wrapped (
object): Wrapped object.
- Returns:
obj (
object): The original object.
RawWrapper¶
delayed_partial¶
-
treevalue.tree.common.delayed_partial(func, *args, **kwargs)¶ - Overview:
Build a delayed partial object. Similar to
functools.partial().- Returns:
delayed: Delayed object.
undelay¶
-
treevalue.tree.common.undelay(p, is_final=True)¶ - Overview:
- Get the value of a given object, it can be a delayed proxy, a simple object or
a nested delayed proxy.
- Arguments:
p (
object): Given object to be undelay.is_final (
bool): Is final value getting or not, default isTrue.
- Returns:
value (
object): Actual value of the given ``p`.
DelayedProxy¶
-
class
treevalue.tree.common.DelayedProxy¶ - Overview:
Base class of all the delayed proxy class.
-
fvalue()¶ - Overview:
Get value of the delayed proxy. Can be accessed in
treevalue.tree.common.undelay()whenis_finalisTrue.- Returns:
value (
object): Calculation result.
-
value()¶ - Overview:
Get value of the delayed proxy. Should make sure the result is cached. Can be accessed in
treevalue.tree.common.undelay()whenis_finalisFalse.- Returns:
value (
object): Calculation result.
DelayedValueProxy¶
-
class
treevalue.tree.common.DelayedValueProxy¶ - Overview:
Simple function delayed proxy.
-
fvalue()¶ - Overview:
Get value of the delayed proxy. Can be accessed in
treevalue.tree.common.undelay()whenis_finalisTrue.- Returns:
value (
object): Calculation result.
DelayedFuncProxy¶
-
class
treevalue.tree.common.DelayedFuncProxy¶ - Overview:
Simple function delayed proxy.
-
fvalue()¶ - Overview:
Get value of the delayed proxy. Can be accessed in
treevalue.tree.common.undelay()whenis_finalisTrue.- Returns:
value (
object): Calculation result.