File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -541,13 +541,14 @@ def __repr__(self) -> str:
541541 def __str__ (self ) -> str :
542542 return self .redacted
543543
544- # This is useful for testing.
545544 def __eq__ (self , other : object ) -> bool :
546- if type (self ) is not type (other ) or not isinstance (other , HiddenText ):
547- return False
548- # The string being used for redaction doesn't also have to match,
549- # just the raw, original string.
550- return self .secret == other .secret
545+ # Equality is particularly useful for testing.
546+
547+ if type (self ) is type (other ):
548+ # The string being used for redaction doesn't also have to match,
549+ # just the raw, original string.
550+ return self .secret == cast (HiddenText , other ).secret
551+ return NotImplemented
551552
552553
553554def hide_value (value : str ) -> HiddenText :
You can’t perform that action at this time.
0 commit comments