def _prebuilt_pkg(cls, pkg_type, fallback):
"""act as lru_cache"""
if pkg_type not in cls._cache_prebuilt_pkg:
pkg = fallback(force_rebuilt=True)
cls._cache_prebuilt_pkg[pkg_type] = pkg
logging.info("_prebuilt_pkg,id:{}".format(id(cls._cache_prebuilt_pkg)))
return cls._cache_prebuilt_pkg[pkg_type]
评论列表
文章目录