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
Fix callbackregistry docstring. #9687
Conversation
Note in particular `**args` (typo) -> `*args`.
""" | ||
register *func* to be called when a signal *s* is generated | ||
func will be called | ||
"""Register *func* to be called when signal *s* is generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not obvious to me what the signal s
is here, or even what type it should have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can indeed be anything (hashable):
In [1]: from matplotlib.cbook import CallbackRegistry; cbr = CallbackRegistry()
In [2]: s = object()
In [3]: cbr.connect(s, print)
Out[3]: 1
In [4]: cbr.process(s, "hello world")
hello world
@@ -381,8 +377,10 @@ def disconnect(self, cid): | |||
|
|||
def process(self, s, *args, **kwargs): | |||
""" | |||
process signal `s`. All of the functions registered to receive | |||
callbacks on `s` will be called with ``**args`` and ``**kwargs`` | |||
Process signal *s*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I'm not sure what s
should be here
Backport PR #9687 on branch v2.1.x
Note in particular
**args
(typo) ->*args
.PR Summary
PR Checklist