Skip to content

Harmonize exceptions for unknown keyword arguments. #24889

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

Merged
merged 1 commit into from
Jan 7, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 5, 2023

... via a kwarg_error helper (see nargs_error for a similar design). In particular the type of the exception thrown by AxesImage.set_extent changed, and parentheses were added to the error thrown by _process_plot_var_args.

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@tacaswell
Copy link
Member

In cases where we have several too many can we still list them all (or the first N>1)?

@anntzer
Copy link
Contributor Author

anntzer commented Jan 5, 2023

FWIW python itself doesn't do so, e.g.

>>> def f(x): pass
... 
>>> f(y=1, z=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() got an unexpected keyword argument 'y'

If you feel strongly about it I can still print all of them, but I tend to prefer consistency with python here.

@anntzer anntzer force-pushed the ke branch 2 times, most recently from be68641 to 0272560 Compare January 5, 2023 22:31
... via a kwarg_error helper (see nargs_error for a similar design).  In
particular the type of the exception thrown by AxesImage.set_extent
changed, and parentheses were added to the error thrown by
_process_plot_var_args.
@QuLogic QuLogic merged commit d12ea34 into matplotlib:main Jan 7, 2023
@anntzer anntzer deleted the ke branch January 7, 2023 09:03
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

Successfully merging this pull request may close these issues.

4 participants