ib_async
ib_async copied to clipboard
Remove mutable default arguments
For example reqHistoricalData has a mutable default argument. I won't list them all here, but a simple PR is required to replace any such cases with immutable default args. Since the code is typed, it will be easy to search for e.g. : List[ and find some of them.
I'm happy to contribute the PR
Good catch.
It looks like most of cases are only parameters for sending data, so technically it's "safe" because the methods never modify the parameters, but still good to be more correct overall.
Feel free to update and add a PR. Just use the next branch for updates.
The data sending API treats empty lists and None as the same value (both just send ""), so modification should be as simple as updating defaults to list[thing] | None = None almost everywhere.