common.py 文件源码

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

项目:fastmat 作者: EMS-TU-Ilmenau 项目源码 文件源码
def __getattr__(self, key):
        # evaluate nested format-string parameters, update format results
        value, lastValue = super(paramDict, self).__getitem__(key), None

        while id(lastValue) != id(value):
            lastValue = value
            if isinstance(value, str):
                if value in self and value != key:
                    value = getattr(self, value)
                elif reFormatString.search(value):
                    value = value %self

            elif (inspect.isroutine(value) and
                  not isinstance(value, IgnoreFunc)):
                value = value(self)
                self[key] = value

        return value


################################################## class Permutation
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号