sortedset.py 文件源码

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

项目:Intranet-Penetration 作者: yuxiaokui 项目源码 文件源码
def _make_cmp(set_op, doc):
        def comparer(self, that):
            if isinstance(that, SortedSet):
                return set_op(self._set, that._set)
            elif isinstance(that, Set):
                return set_op(self._set, that)
            else:
                raise TypeError('can only compare to a Set')

        comparer.__name__ = '__{0}__'.format(set_op.__name__)
        comparer.__doc__ = 'Return True if and only if ' + doc

        return comparer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号