computation.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:metapensiero.reactive 作者: azazel75 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号