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

Revert change of parameter name in annotate()#12383

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

Conversation

timhoffm
Copy link
Member

@timhoffmtimhoffm commentedOct 3, 2018
edited by jklymak
Loading

PR Summary

Change the parameter nameannotate(text, ...) back toannotate(s, ...) (was introduced in#10830).

Fixes#12325.

Not sure if it's ok to go back straight. IMO, it's rather uncommon to pass this param as kwarg. But technically, that's an API change again. If people have adapted fors -> text in 3.0, they would have to adapt back again.

Possible alternative

Generally, I'd rather have descriptive argument names such astext ortitle instead ofs. However, I'm learning to be more careful with API changes and these things would have to go through a deprecation mechanism with a transition phase of allowing both. If there is a general approval to migrate parameter names in such a way, I can apply the mechanism here and just adds back in as a fallback (including changing the originalAnnotation class as well.

Note: Thinking about it, a transition mechanism is technically possible, however a bit complicated. We would have to support:

  • annotate('text', xy)
  • annotate(s='text', xy=xy)
  • annotate(text='text', xy=xy)

which would require

def annotate(self, text=None, xy=None, ..., s=None):"""annotate(self, text, xy, ...)"""# merge text and s# check that xy is not None

@anntzer
Copy link
Contributor

ftr there's#7966 re: signature-overloaded functions, which can easily be adapted to handle deprecations in signature changes.

Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

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

I think doing an additional deprecation cycle for this specific un-change isreally not worth it.

@timhoffmtimhoffmforce-pushed therevert-annotate-parameter-name branch from6021a60 toedaeca4CompareOctober 3, 2018 10:50
@jklymakjklymak added this to thev3.0.x milestoneOct 3, 2018
@jklymak
Copy link
Member

I think this is a bug fix for3.0.x. But@tacaswell,@dopplershift, or@efiring should weigh in on whether this reversion needs to be deprecated.

Copy link
Member

@efiringefiring left a comment

Choose a reason for hiding this comment

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

Looks fine; no need for anything more than this.

@efiring
Copy link
Member

As a general comment, I think that sticking with "s" is the way to go. It stands for "string", contrasts adequately with "xy", avoids confusion or duplication with thetext function and method, and is usually used as a positional argument anyway. And it has been there since the beginning, hasn't it?

@efiringefiring merged commitbfd25e7 intomatplotlib:masterOct 4, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 4, 2018
@timhoffmtimhoffm deleted the revert-annotate-parameter-name branchOctober 4, 2018 06:32
@anntzeranntzer mentioned this pull requestJan 7, 2019
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring left review comments

@anntzeranntzeranntzer approved these changes

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

Successfully merging this pull request may close these issues.

4 participants
@timhoffm@anntzer@jklymak@efiring

[8]ページ先頭

©2009-2025 Movatter.jp