enum.py 文件源码

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

项目:django-clubhouse 作者: chazmead 项目源码 文件源码
def __hash__(self):
        # taken from collections.Set
        max_i = sys.maxint
        mask = 2 * max_i + 1
        n = len(self)
        h = 1927868237 * (n + 1)
        h &= mask
        for x in self:
            hx = hash(x)
            h ^= (hx ^ (hx << 16) ^ 89869747) * 3644798167
            h &= mask
        h = h * 69069 + 907133923
        h &= mask
        if h > max_i:
            h -= mask + 1
        if h == -1:
            h = 590923713
        return h
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号