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

Skip to content

Commit 97ba060

Browse files
committed
Clarify behavior of CallbackRegistry.disconnect with nonexistent cids.
This behavior is actually relied upon in some parts of the codebase, so let's just document it.
1 parent 2e75ed0 commit 97ba060

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ def _remove_proxy(self, proxy, *, _is_finalizing=sys.is_finalizing):
199199
del self._func_cid_map[signal]
200200

201201
def disconnect(self, cid):
202-
"""Disconnect the callback registered with callback id *cid*."""
202+
"""
203+
Disconnect the callback registered with callback id *cid*.
204+
205+
No error is raised if such a callback does not exist.
206+
"""
203207
for eventname, callbackd in list(self.callbacks.items()):
204208
try:
205209
del callbackd[cid]

0 commit comments

Comments
 (0)