From 292ea30298513b668b5d0488f2db1b7ff0f7541b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 19 Apr 2021 14:46:46 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Allow=20equality=20checks=20betw?= =?UTF-8?q?een=20casings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- royalnet/engineer/bullet/casing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/royalnet/engineer/bullet/casing.py b/royalnet/engineer/bullet/casing.py index 03e14e54..e667c43a 100644 --- a/royalnet/engineer/bullet/casing.py +++ b/royalnet/engineer/bullet/casing.py @@ -39,3 +39,6 @@ class Casing(metaclass=abc.ABCMeta): :return: A :class:`int` value that uniquely identifies the object in this Python interpreter process. """ raise NotImplementedError() + + def __eq__(self, other) -> bool: + return self.__class__ is other.__class__ and hash(self) == hash(other)