@@ -43,6 +43,10 @@ def __eq__(self, other: RedditErrorItem | list[str]) -> bool:
4343 )
4444 return super ().__eq__ (other )
4545
46+ def __hash__ (self ) -> int :
47+ """Return the hash of the current instance."""
48+ return hash (self .__class__ .__name__ ) ^ hash ((self .error_type , self .message , self .field ))
49+
4650 @_deprecate_args ("error_type" , "message" , "field" )
4751 def __init__ (
4852 self ,
@@ -65,8 +69,7 @@ def __init__(
6569 def __repr__ (self ) -> str :
6670 """Return an object initialization representation of the instance."""
6771 return (
68- f"{ self .__class__ .__name__ } (error_type={ self .error_type !r} ,"
69- f" message={ self .message !r} , field={ self .field !r} )"
72+ f"{ self .__class__ .__name__ } (error_type={ self .error_type !r} , message={ self .message !r} , field={ self .field !r} )"
7073 )
7174
7275 def __str__ (self ) -> str :
@@ -84,8 +87,7 @@ class DuplicateReplaceException(ClientException):
8487 def __init__ (self ):
8588 """Initialize a :class:`.DuplicateReplaceException` instance."""
8689 super ().__init__ (
87- "A duplicate comment has been detected. Are you attempting to call"
88- " 'replace_more_comments' more than once?"
90+ "A duplicate comment has been detected. Are you attempting to call 'replace_more_comments' more than once?"
8991 )
9092
9193
@@ -145,8 +147,7 @@ def __init__(self, *, actual: int, maximum_size: int):
145147 self .maximum_size = maximum_size
146148 self .actual = actual
147149 super ().__init__ (
148- f"The media that you uploaded was too large (maximum size is { maximum_size } "
149- f" bytes, uploaded { actual } bytes)"
150+ f"The media that you uploaded was too large (maximum size is { maximum_size } bytes, uploaded { actual } bytes)"
150151 )
151152
152153
0 commit comments