Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39694f2

Browse files
authored
Merge pull request #9687 from anntzer/callbackregistry-docstring
Fix callbackregistry docstring.
2 parents 92044bb + 440e464 commit 39694f2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ def _exception_printer(exc):
255255

256256

257257
class CallbackRegistry(object):
258-
"""Handle registering and disconnecting for a set of signals and
259-
callbacks:
258+
"""Handle registering and disconnecting for a set of signals and callbacks:
260259
261260
>>> def oneat(x):
262261
... print('eat', x)
@@ -332,9 +331,7 @@ def __setstate__(self, state):
332331
self.__init__(**state)
333332

334333
def connect(self, s, func):
335-
"""
336-
register *func* to be called when a signal *s* is generated
337-
func will be called
334+
"""Register *func* to be called when signal *s* is generated.
338335
"""
339336
self._func_cid_map.setdefault(s, WeakKeyDictionary())
340337
# Note proxy not needed in python 3.
@@ -363,8 +360,7 @@ def _remove_proxy(self, proxy):
363360
del self._func_cid_map[signal]
364361

365362
def disconnect(self, cid):
366-
"""
367-
disconnect the callback registered with callback id *cid*
363+
"""Disconnect the callback registered with callback id *cid*.
368364
"""
369365
for eventname, callbackd in list(six.iteritems(self.callbacks)):
370366
try:
@@ -381,8 +377,10 @@ def disconnect(self, cid):
381377

382378
def process(self, s, *args, **kwargs):
383379
"""
384-
process signal `s`. All of the functions registered to receive
385-
callbacks on `s` will be called with ``**args`` and ``**kwargs``
380+
Process signal *s*.
381+
382+
All of the functions registered to receive callbacks on *s* will be
383+
called with ``*args`` and ``**kwargs``.
386384
"""
387385
if s in self.callbacks:
388386
for cid, proxy in list(six.iteritems(self.callbacks[s])):

0 commit comments

Comments
 (0)