File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -543,13 +543,17 @@ def __str__(self) -> str:
543543
544544 def __eq__ (self , other : object ) -> bool :
545545 # Equality is particularly useful for testing.
546-
547546 if type (self ) is type (other ):
548547 # The string being used for redaction doesn't also have to match,
549548 # just the raw, original string.
550549 return self .secret == cast (HiddenText , other ).secret
551550 return NotImplemented
552551
552+ # Disable hashing, since we have a custom __eq__ and don't need hash-ability
553+ # (yet). The only required property of hashing is that objects which compare
554+ # equal have the same hash value.
555+ __hash__ = None # type: ignore[assignment]
556+
553557
554558def hide_value (value : str ) -> HiddenText :
555559 return HiddenText (value , redacted = "****" )
You can’t perform that action at this time.
0 commit comments