We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__hash__
1 parent a374384 commit a9daab6Copy full SHA for a9daab6
1 file changed
src/response_codes/__init__.py
@@ -137,6 +137,14 @@ def __ge__(cls, other: int) -> bool:
137
return cls.status_code >= other
138
return NotImplemented
139
140
+ def __hash__(cls) -> int:
141
+ """Return hash based on the status code.
142
+
143
+ Returns:
144
+ int: Hash value based on the status code
145
+ """
146
+ return hash(cls.status_code)
147
148
149
class HTTPStatus(Exception, metaclass=HTTPStatusMeta):
150
"""Base class for HTTP status code exceptions.
0 commit comments