base.py 文件源码

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

项目:stor 作者: counsyl 项目源码 文件源码
def fnmatch(self, pattern, normcase=None):
        """Return ``True`` if :attr:`name` matches the given ``pattern``.

        .. seealso:: :func:`fnmatch.fnmatch`

        Args:
            pattern (str): A filename pattern with wildcards,
                for example ``'*.py'``. If the pattern contains a `normcase`
                attribute, it is applied to the name and path prior to comparison.
            normcase (func, optional): A function used to normalize the pattern and
                filename before matching. Defaults to :meth:`self.module`, which defaults
                to :meth:`os.path.normcase`.

        """
        default_normcase = getattr(pattern, 'normcase', self.path_module.normcase)
        normcase = normcase or default_normcase
        name = normcase(self.name)
        pattern = normcase(pattern)
        return fnmatch.fnmatchcase(name, pattern)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号