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

Why set default value of dictionary parameters to None, but then change them to {} at beginning of method? #143

Open
derekmahar opened this issue Mar 19, 2024 · 1 comment

Comments

@derekmahar
Copy link

In several API methods like krakenex.api._query, why do you set the default value of some dictionary parameters to None, but then at the beginning of the method, immediately change None to the empty dictionary {}? Why not instead set the parameter default values to {}?

For example, why not replace

def _query(self, urlpath, data, headers=None, timeout=None):
        if data is None:
            data = {}
        if headers is None:
            headers = {}

with

def _query(self, urlpath, data={}, headers={}, timeout=None):

?

@veox
Copy link
Owner

veox commented Jul 1, 2024

Looks like an atavism, judging by commits 839b9a1 and 11ac129...

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

No branches or pull requests

2 participants