Add a new parameter session_callable to the init method. Store this callable as an instance attribute. Modify the initialize_session method to use this stored callable if no other callable is provided during the session initialization.
Update the usage: When creating an AwsClient instance, pass the session_callable directly to it. This makes the relationship between the AwsClient and the session initialization logic clearer and more direct.
Update the AwsClient class:
Add a new parameter session_callable to the init method. Store this callable as an instance attribute. Modify the initialize_session method to use this stored callable if no other callable is provided during the session initialization.
Update the usage: When creating an AwsClient instance, pass the session_callable directly to it. This makes the relationship between the AwsClient and the session initialization logic clearer and more direct.
End result example:
instead of