request_strategy parameter for APIClient constructor
See original GitHub issueHi Mike,
I’m enjoying using this library, so thanks for your time and efforts putting it together!
Is your feature request related to a problem? Please describe.
I’d like to pass a RequestStrategy
to the client constructor.
Describe the solution you’d like
Similar to how the client accepts authentication_method
et al. as constructor params, I’d like to be able to pass a request_strategy
instance one way or another.
Describe alternatives you’ve considered
I construct the client and then call set_request_strategy()
on the client instance.
Additional context
Is it that the request strategy needs to be a distinct instance per client given the client is persisted on the strategy? Would you consider a parameter that accepts a callable which returns a strategy instance? It might be RequestStrategy
type or something more complicated. Or perhaps a None
default value for parameter that accepts an instance so that if nothing is passed in a fresh RequestStragegy
can be constructed for the client?
As mentioned above, in terms of LOC this is only saving 1 call to set_request_strategy()
so I’d entirely understand if you decide its not worth the effort!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
I would like to suggest setting this parameter in the attribute of the child class. so as not to override the
__init__
method.resolved by #58