Implement equality for SecretBox

This commit is contained in:
Campbell Alden 2026-09-03 22:56:14 +09:00
parent 04440e6270
commit f44f054f56

View file

@ -7,6 +7,12 @@ class SecretBox[T]:
def expose_secret(self) -> T: def expose_secret(self) -> T:
return self._item return self._item
def __eq__(self, other):
if not isinstance(other, SecretBox):
return False
return self._item == other._item
def __str__(self): def __str__(self):
return '<SECRET>' return '<SECRET>'