I have a get function that takes multiple query parameters which might look like this:
def get(
key: Optional[str] = "key"
value: Optional[str] = "value"
param1: Optional[int] = -1
)
What I want to do is, I want to put these parameter definitions in a separate variable. Is it possible to do something like this?
param_definition = { # some struct here, or maybe a Model class
key: Optional[str] = "key"
value: Optional[str] = "value"
param1: Optional[int] = -1
}
def get(*params: param_definition):
...
Can this be done? If no, is there anything similar and more maintainable that can be done here?