Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mutable default arguments #81

Open
npbaskerville opened this issue Oct 18, 2024 · 1 comment
Open

Remove mutable default arguments #81

npbaskerville opened this issue Oct 18, 2024 · 1 comment

Comments

@npbaskerville
Copy link

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

@mattsta
Copy link
Contributor

mattsta commented Oct 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants