util.py 文件源码

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

项目:qiime2 作者: qiime2 项目源码 文件源码
def warning():
    def _warnformat(msg, category, filename, lineno, file=None, line=None):
        return '%s:%s: %s: %s\n' % (filename, lineno, category.__name__, msg)

    default_warn_format = warnings.formatwarning
    try:
        warnings.formatwarning = _warnformat
        yield warnings.warn
    finally:
        warnings.formatwarning = default_warn_format


# Descriptor protocol for creating an attribute that is bound to an
# (arbitrarily nested) attribute accessible to the instance at runtime.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号