Revert change of parameter name in annotate()#12383
Revert change of parameter name in annotate()#12383efiring merged 1 commit intomatplotlib:masterfrom
Conversation
|
ftr there's #7966 re: signature-overloaded functions, which can easily be adapted to handle deprecations in signature changes. |
anntzer
left a comment
There was a problem hiding this comment.
I think doing an additional deprecation cycle for this specific un-change is really not worth it.
6021a60 to
edaeca4
Compare
|
I think this is a bug fix for |
efiring
left a comment
There was a problem hiding this comment.
Looks fine; no need for anything more than this.
|
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 the |
PR Summary
Change the parameter name
annotate(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 for
s -> textin 3.0, they would have to adapt back again.Possible alternative
Generally, I'd rather have descriptive argument names such as
textortitleinstead 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 addsback in as a fallback (including changing the originalAnnotationclass 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