Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a make-parameter-keyword-only-with-deprecation decorator.#13601

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 1 commit intomatplotlib:masterfromanntzer:make_positional_only
Mar 13, 2019

Conversation

anntzer
Copy link
Contributor

(discussed in#13128 (comment))

... and use it to make theblock argument of plt.show() keyword only
(with deprecation), with the idea of making the future signature
plt.show(figures=None, *, block=True) (discussed in#13590).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzer added this to thev3.1.0 milestoneMar 6, 2019
@QuLogic
Copy link
Member

I'm not sure the title of this PR/commit is the same as what it's doing.

@@ -242,6 +242,12 @@ def trigger_manager_draw(manager):

@staticmethod
def show(*args, **kwargs):
if args or {*kwargs} - {"block"}:
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't that be simply

def show(*args, *, block=None, **kwargs):    if args or kwargs:

Note also that block is not used within the method.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

But it's legal to doshow(block=...); sure,block is not used but I don't want to emit a deprecation in that case as that makes it harder to write backend-independent code (or if you really want to warn, it should be something like "the block parameter has no effect in the nbagg backend").

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what official best practices are here, but I would make allshow() methods identical in their API. They override_Backend.show() and should formally be substitutable. Any non-working parameters should be warned about and not be ignored or rejected with a type error.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oh sorry, I missed that you proposed changing the signature. Yes, that works, pushed.

@anntzer
Copy link
ContributorAuthor

@QuLogic oops :)

@anntzeranntzer changed the titleAdd a make-parameter-positional-only-with-deprecation decorator.Add a make-parameter-keyword-only-with-deprecation decorator.Mar 7, 2019
... and use it to make the `block` argument of plt.show() keyword only(with deprecation), with the idea of making the future signature`plt.show(figures=None, *, block=True)`.
Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

Subject to CI.

@jklymakjklymak merged commitedf1bb7 intomatplotlib:masterMar 13, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestMar 13, 2019
@anntzeranntzer deleted the make_positional_only branchMarch 13, 2019 22:22
jklymak added a commit that referenced this pull requestMar 13, 2019
…601-on-v3.1.xBackport PR#13601 on branch v3.1.x (Add a make-parameter-keyword-only-with-deprecation decorator.)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.1.0
Development

Successfully merging this pull request may close these issues.

4 participants
@anntzer@QuLogic@jklymak@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp