def __init__(self, parent, func, on_error=None, equal=None,
initial_value=undefined, *, tracker=None):
"""
:param tracker: an instance of :class:`~.tracker.Tracker` that is
managing the computing process
:param parent: a possible parent computation owning this
:param func: the function to be computed
:param on_error: an optional callback that will be called if an
error is raised during computation
:param equal: an optional equality comparison function to be used
instead of the default ``operator.eq``
:param initial_value: an optional initial value. By default it is a
marker value called ``undefined``, that will be replaced with the
first calculated value without generating any item.
"""
func = functools.partial(self._auto, func)
self._equal = equal or operator.eq
self.current_value = initial_value
self._tracker = tracker
self._init_next_value_container()
super().__init__(parent, func, on_error, tracker=tracker)
评论列表
文章目录