parameters.py 文件源码

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

项目:phoebe2 作者: phoebe-project 项目源码 文件源码
def set_value(self, value, **kwargs):
        """

        kwargs are passed on to filter
        """
        _orig_value = deepcopy(self.get_value())

        if self._bundle is None:
            raise ValueError("ConstraintParameters must be attached from the bundle, and cannot be standalone")
        value = str(value) # <-- in case unicode
        # if the user wants to see the expression, we'll replace all
        # var.safe_label with var.curly_label
        self._value, self._vars = self._parse_expr(value)
        #~ print "***", self.uniquetwig, self.uniqueid
        self._add_history(redo_func='set_value', redo_kwargs={'value': value, 'uniqueid': self.uniqueid}, undo_func='set_value', undo_kwargs={'value': _orig_value, 'uniqueid': self.uniqueid})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号