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
评论列表
文章目录