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
do not use kwargs in ExistDB.__init__ #1
Comments
Thanks, good idea. |
After looking at the code again, the reason I'm using |
Yes, I noticed that this was one use for
and then have
|
Thanks for this prompt to revisit the timeout handling, it turns out I wasn't actually passing the configured timeout through to the rest api requests! I hadn't previously figured out a way to test the timeout handling, but with this update it seemed much clearer how to test the different possible cases. |
Fix will be in the next release |
As we speak the
__init__
forExistDB
is defined like this:However, I do not see any reason for
**kwargs
there in the current code base.**kwargs
is normally useful when a function accepts a series of parameters that it does not itself understand but that are going to be passed to another function. It allows passing the parameter payload to the other function opaquely, but the code of__init__
currently does not do this.Conversely, using
**kwargs
has for consequence to hide possible errors in the parameter list. I had a case where I was doingExistDB(usernname="whatever", ...)
Note the typo in the parameter name. With**kwargs
the typo is ignored. If**kwargs
were replaced withtimeout=None
, the Python parser would immediately raise an error when an unsupported parameter is passed.The text was updated successfully, but these errors were encountered: