validators.py 文件源码

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

项目:Gypsy 作者: benticarlos 项目源码 文件源码
def _lazy_re_compile(regex, flags=0):
    """Lazily compile a regex with flags."""
    def _compile():
        # Compile the regex if it was not passed pre-compiled.
        if isinstance(regex, six.string_types):
            return re.compile(regex, flags)
        else:
            assert not flags, "flags must be empty if regex is passed pre-compiled"
            return regex
    return SimpleLazyObject(_compile)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号