Repository: redis/redis-py
File: redis/retry.py (Python)

Code before:
            socket.timeout,
        ),
    ):
        """
        Initialize a `Retry` object with a `Backoff` object
        that retries a maximum of `retries` times.
        `retries` can be negative to retry forever.
        You can specify the types of supported errors which trigger
        a retry with the `supported_errors` parameter.
        """
        self._backoff = backoff
        self._retries = retries
        self._supported_errors = supported_errors

    def __eq__(self, other: Any) -> bool:
        if not isinstance(other, Retry):
            return NotImplemented

        return (
            self._backoff == other._backoff
            and self._retries == other._retries
            and set(self._supported_errors) == set(other._supported_errors)
        )

    def __hash__(self) -> int:
        return hash((self._backoff, self._retries, self._supported_errors))

    def update_supported_errors(
        self, specified_errors: Iterable[Type[Exception]]
    ) -> None:
        """
        Updates the supported errors with the specified error types
        """
        self._supported_errors = tuple(
            set(self._supported_errors + tuple(specified_errors))
        )

    def get_retries(self) -> int:
        """
        Get the number of retries.
        """
        return self._retries

    def update_retries(self, value: int) -> None:
        """
        Set the number of retries.
        """
        self._retries = value

    def call_with_retry(
        self,

Review comment (suggestion):
Since __eq__ compares supported_errors as a set, the __hash__ method should convert supported_errors to a frozenset to ensure consistent hash values regardless of the tuple order. Consider: return hash((self._backoff, self._retries, frozenset(self._supported_errors))).
```suggestion
        return hash((self._backoff, self._retries, frozenset(self._supported_errors)))
```

Code after:
            socket.timeout,
        ),
    ):
        """
        Initialize a `Retry` object with a `Backoff` object
        that retries a maximum of `retries` times.
        `retries` can be negative to retry forever.
        You can specify the types of supported errors which trigger
        a retry with the `supported_errors` parameter.
        """
        self._backoff = backoff
        self._retries = retries
        self._supported_errors = supported_errors

    def __eq__(self, other: Any) -> bool:
        if not isinstance(other, Retry):
            return NotImplemented

        return (
            self._backoff == other._backoff
            and self._retries == other._retries
            and set(self._supported_errors) == set(other._supported_errors)
        )

    def __hash__(self) -> int:
        return hash((self._backoff, self._retries, frozenset(self._supported_errors)))

    def update_supported_errors(
        self, specified_errors: Iterable[Type[Exception]]
    ) -> None:
        """
        Updates the supported errors with the specified error types
        """
        self._supported_errors = tuple(
            set(self._supported_errors + tuple(specified_errors))
        )

    def get_retries(self) -> int:
        """
        Get the number of retries.
        """
        return self._retries

    def update_retries(self, value: int) -> None:
        """
        Set the number of retries.
        """
        self._retries = value

    def call_with_retry(
        self,