Repository: boto/boto3
File: boto3/s3/transfer.py (Python)

Code before:
            downloaded stream as well.

        :param use_threads: If True, threads will be used when performing
            S3 transfers. If False, no threads will be used in
            performing transfers; all logic will be run in the current thread.

        :param max_bandwidth: The maximum bandwidth that will be consumed
            in uploading and downloading file content. The value is an integer
            in terms of bytes per second.

        :param preferred_transfer_client: String specifying preferred transfer
            client for transfer operations.

            Current supported settings are:
              * auto (default) - Use the CRTTransferManager when calls
                  are made with supported environment and settings.
              * classic - Only use the origin S3TransferManager with
                  requests. Disables possible CRT upgrade on requests.
              * crt - Only use the CRTTransferManager with requests.
        """
        super().__init__(
            multipart_threshold=multipart_threshold,
            max_request_concurrency=max_concurrency,
            multipart_chunksize=multipart_chunksize,
            num_download_attempts=num_download_attempts,
            max_io_queue_size=max_io_queue,
            io_chunksize=io_chunksize,
            max_bandwidth=max_bandwidth,
        )
        # Some of the argument names are not the same as the inherited
        # S3TransferConfig so we add aliases so you can still access the
        # old version of the names.
        for alias in self.ALIAS:
            setattr(
                self,
                alias,
                object.__getattribute__(self, self.ALIAS[alias]),
            )
        self.use_threads = use_threads
        self.preferred_transfer_client = preferred_transfer_client

    def __setattr__(self, name, value):
        # If the alias name is used, make sure we set the name that it points
        # to as that is what actually is used in governing the TransferManager.
        if name in self.ALIAS:
            super().__setattr__(self.ALIAS[name], value)
        # Always set the value of the actual name provided.
        super().__setattr__(name, value)

    def __getattribute__(self, item):
        value = object.__getattribute__(self, item)

Review comment (suggestion):
I feel like we should document which config options are allowed when setting `preferred_transfer_client` to `crt`. In the current state of this PR, if users try to set an unsupported value, they will receive an exception that tells them which config options they set are invalid, but there is no documentation about which options are allowed.

Code after:

        :param io_chunksize: The max size of each chunk in the io queue.
            Currently, this is size used when ``read`` is called on the
            downloaded stream as well. Note: This value is ignored when
            resolved transfer manager type is CRTTransferManager.

        :param use_threads: If True, threads will be used when performing
            S3 transfers. If False, no threads will be used in
            performing transfers; all logic will be run in the current thread.
            Note: This value is ignored when resolved transfer manager type is
            CRTTransferManager.

        :param max_bandwidth: The maximum bandwidth that will be consumed
            in uploading and downloading file content. The value is an integer
            in terms of bytes per second. Note: This value is ignored when
            resolved transfer manager type is CRTTransferManager.

        :param preferred_transfer_client: String specifying preferred transfer
            client for transfer operations.

            Current supported settings are:
              * auto (default) - Use the CRTTransferManager when calls
                  are made with supported environment and settings.
              * classic - Only use the origin S3TransferManager with
                  requests. Disables possible CRT upgrade on requests.
              * crt - Only use the CRTTransferManager with requests.
        """
        init_args = {
            'multipart_threshold': multipart_threshold,
            'max_concurrency': max_concurrency,
            'multipart_chunksize': multipart_chunksize,
            'num_download_attempts': num_download_attempts,
            'max_io_queue': max_io_queue,
            'io_chunksize': io_chunksize,
            'use_threads': use_threads,
            'max_bandwidth': max_bandwidth,
            'preferred_transfer_client': preferred_transfer_client,
        }
        resolved = self._resolve_init_args(init_args)
        super().__init__(
            multipart_threshold=resolved['multipart_threshold'],
            max_request_concurrency=resolved['max_concurrency'],
            multipart_chunksize=resolved['multipart_chunksize'],
            num_download_attempts=resolved['num_download_attempts'],
            max_io_queue_size=resolved['max_io_queue'],
            io_chunksize=resolved['io_chunksize'],
            max_bandwidth=resolved['max_bandwidth'],
        )
        # Some of the argument names are not the same as the inherited
        # S3TransferConfig so we add aliases so you can still access the
        # old version of the names.