FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make `functions` param to secondary_x/yaxis not keyword-only. by anntzer · Pull Request #28133 · matplotlib/matplotlib · GitHub

Repository navigation

Make functions param to secondary_x/yaxis not keyword-only. - #28133

Merged
QuLogic merged 1 commit into
matplotlib:mainfrom
anntzer:saxkw
Apr 25, 2024
Merged

QuLogic merged 1 commit into
matplotlib:mainfrom
anntzer:saxkw

Conversation

anntzer commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

I suspect the parameter was made keyword-only because the originally planned signature (#11859) was secondary_xaxis(location, forward=..., inverse=...) where the keywords actually add some semantics (though that signature overall seems worse); however, for a single functions parameter, having to type an extra functions= in the call doesn't help the reader much (either they know what secondary_x/yaxis does, in which case the explicit kwarg doesn't matter, or they don't, in which case the kwarg name hardly helps)... and is a bit annoying. See the modified gallery entry, for example.

PR summary

PR checklist

github-actions Bot added the Documentation: user guide files in galleries/users_explain or doc/users label Apr 24, 2024

timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ok. Stubs need to be updated.

I suspect the parameter was made keyword-only because the originally
planned signature was `secondary_xaxis(location, forward=...,
inverse=...)` where the keywords actually add some semantics (though
that signature overall seems worse); however, for a single `functions`
parameter, having to type an extra `functions=` in the call doesn't help
the reader much (either they know what secondary_x/yaxis does, in which
case the explicit kwarg doesn't matter, or they don't, in which case the
kwarg name hardly helps)... and is a bit annoying.  See the modified
gallery entry, for example.

anntzer commented Apr 24, 2024

Copy link
Copy Markdown
Contributor Author

oops, done.

Copy link
Copy Markdown
Member

Is an API change note worthwhile? If not, anyone can merge.

oscargus added this to the v3.10.0 milestone Apr 25, 2024

Copy link
Copy Markdown
Member

An API change note is not neccessary since we're only relaxing the API. It's also not very helpful: Nobody will read through API changes, see this and take an action ("Finally, this is not kwonly anymore - I go through my code and change to positional use" is not gonna happen). So the note would mostly be noise. The only possible benefit would be a .. versionchanged:: note in the function, so that a user could decide to write backward-compatible code. - But then again. I don't think, we have such information consistently. I would not bother.

QuLogic merged commit 91234e2 into matplotlib:main Apr 25, 2024
anntzer deleted the saxkw branch April 25, 2024 16:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: user guide files in galleries/users_explain or doc/users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL