-
Notifications
You must be signed in to change notification settings - Fork 930
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
Should a function with **kwargs
throw unexpected keyword argument
?
#1749
Comments
I don't think I understand the problem here. You're providing an unexpected argument, and the error message says exactly that. What is misleading, or what would you expect it to say instead? |
I think that the misleading element, according to @FVolral, is that the unexpected keyword argument is passed from If my understanding is right, then I think that librosa is working as intended here, and consistently with packages like NumPy or Matplotlib. @FVolral try running
The exception is thrown in |
**kwargs
throw unexpected keyword argument
?
Ahh, I see. @lostanlen is correct - this is not copypasta, but instead an exception being raised one layer deeper in the call stack than the user might be expecting. Since the underlying exception here is a Alternatively, we could imagine cooking up some machinery that would inspect the call signature of nested calls against the kwargs we're going to send through before calling, and raise an error earlier, but this seems like a pretty heavy-weight solution for a rather niche problem. In general, I don't think there's too much we can do here, unless we want to go the route of explicitly registering all pass-through kwargs in the call signature. Given the complexity of the call signature already, I'm not inclined to go that route. |
hello, there is probably a small typo with tonnetz. If you use a bad argument, lets says n_fft, you will got
the error message
TypeError: **chroma_cqt()** got an unexpected keyword argument 'n_fft'
which is misleading. It smells the copypastaThe text was updated successfully, but these errors were encountered: