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

Code before:
        errors specified in `retry_on_error`.

        2. Define a `Retry` object with configured 'supported_errors' and set
        it to the `retry` parameter - with this approach you completely redefine
        the errors on which retries will happen.

        `retry_on_timeout` is deprecated - please include the TimeoutError
        either in the Retry object or in the `retry_on_error` list.

        When 'connection_pool' is provided - the retry configuration of the
        provided pool will be used.

        Args:

        single_connection_client:
            if `True`, connection pool is not used. In that case `Redis`
            instance use is not thread safe.
        decode_responses:
            if `True`, the response will be decoded to utf-8.
            Argument is ignored when connection_pool is provided.
        driver_info:
            Optional DriverInfo object to identify upstream libraries.
            Argument is ignored when connection_pool is provided.
        maint_notifications_config:
            configuration the pool to support maintenance notifications - see
            `redis.maint_notifications.MaintNotificationsConfig` for details.
            Only supported with RESP3
            If not provided and protocol is RESP3, the maintenance notifications
            will be enabled by default (logic is included in the connection pool
            initialization).
            Argument is ignored when connection_pool is provided.
        """
        if event_dispatcher is None:
            self._event_dispatcher = EventDispatcher()
        else:
            self._event_dispatcher = event_dispatcher
        if not connection_pool:
            if not retry_on_error:
                retry_on_error = []
            if driver_info is not None:
                computed_lib_name = driver_info.formatted_name
            else:
                computed_lib_name = lib_name

            kwargs = {
                "db": db,
                "username": username,
                "password": password,
                "socket_timeout": socket_timeout,
                "encoding": encoding,
                "encoding_errors": encoding_errors,

Review comment (suggestion):
The current implementation causes to have lib_name to be ignored - it will be valuable addition to the details in the docstrings. 

Code after:
        1. Set the `retry_on_error` to a list of the error/s to retry on, and
        you can also set `retry` to a valid `Retry` object(in case the default
        one is not appropriate) - with this approach the retries will be triggered
        on the default errors specified in the Retry object enriched with the
        errors specified in `retry_on_error`.

        2. Define a `Retry` object with configured 'supported_errors' and set
        it to the `retry` parameter - with this approach you completely redefine
        the errors on which retries will happen.

        `retry_on_timeout` is deprecated - please include the TimeoutError
        either in the Retry object or in the `retry_on_error` list.

        When 'connection_pool' is provided - the retry configuration of the
        provided pool will be used.

        Args:

        single_connection_client:
            if `True`, connection pool is not used. In that case `Redis`
            instance use is not thread safe.
        decode_responses:
            if `True`, the response will be decoded to utf-8.
            Argument is ignored when connection_pool is provided.
        driver_info:
            Optional DriverInfo object to identify upstream libraries.
            If provided, lib_name and lib_version are ignored.
            If not provided, a DriverInfo will be created from lib_name and lib_version.
            Argument is ignored when connection_pool is provided.
        lib_name:
            **Deprecated.** Use driver_info instead. Library name for CLIENT SETINFO.
        lib_version:
            **Deprecated.** Use driver_info instead. Library version for CLIENT SETINFO.
        maint_notifications_config:
            configuration the pool to support maintenance notifications - see
            `redis.maint_notifications.MaintNotificationsConfig` for details.
            Only supported with RESP3
            If not provided and protocol is RESP3, the maintenance notifications
            will be enabled by default (logic is included in the connection pool
            initialization).
            Argument is ignored when connection_pool is provided.
        """
        if event_dispatcher is None:
            self._event_dispatcher = EventDispatcher()
        else:
            self._event_dispatcher = event_dispatcher
        if not connection_pool:
            if not retry_on_error:
                retry_on_error = []

            # Handle driver_info: if provided, use it; otherwise create from lib_name/lib_version