quantiphy.py 文件源码

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

项目:quantiphy 作者: KenKundert 项目源码 文件源码
def _initialize_preferences(cls):
        if id(cls) in cls._initialized:
            return
        cls._initialized.add(id(cls))
        if cls == Quantity:
            prefs = DEFAULTS
        else:
            parent = cls.__mro__[1]
                # for some reason I cannot get super to work right
            prefs = parent._preferences
        # copy dict so any changes made to parent's preferences do not affect us
        prefs = dict(prefs)
        cls._preferences = ChainMap({}, prefs)
            # use chain to support use of contexts
            # put empty map in as first so user never accidentally deletes or
            # changes one of the initial preferences

    # set preferences {{{3
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号