I try to avoide to if or switch in python, but not sure if it is possible. For example, there are existing methods that can retrieve certain information, the name of each methods are
- get_by_a
- get_by_b
- get_by_c
The formate to use those methods is like
output = client.get_by_a(**kwarg)
I am thinking to create a variable that represent the a, b, c part and the format will look like
variable = a
output = client.get_by_variable(**kwarg)
I cannot find a way to achieve it, any suggestion for this?