Skip to content
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

Merged
merged 1 commit into from Nov 5, 2017

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 4, 2017

Note in particular **args (typo) -> *args.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

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.
Copy link
Member

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

Copy link
Contributor Author

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*.
Copy link
Member

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

@dstansby dstansby added this to the v2.1.1 milestone Nov 4, 2017
@dstansby dstansby merged commit 39694f2 into matplotlib:master Nov 5, 2017
lumberbot-app bot pushed a commit that referenced this pull request Nov 5, 2017
@anntzer anntzer deleted the callbackregistry-docstring branch November 5, 2017 16:54
dstansby added a commit that referenced this pull request Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants