document.py 文件源码

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

项目:umongo 作者: Scille 项目源码 文件源码
def __eq__(self, other):
        from .data_objects import Reference
        if self.pk is None:
            return self is other
        elif isinstance(other, self.__class__) and other.pk is not None:
            return self.pk == other.pk
        elif isinstance(other, DBRef):
            return other.collection == self.collection.name and other.id == self.pk
        elif isinstance(other, Reference):
            return isinstance(self, other.document_cls) and self.pk == other.pk
        return NotImplemented
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号