def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return self.__class__ == type(other)
        return self.key == other.key
Compare with another reference
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/dispatch/saferef.py/BoundMethodWeakref.__eq__