8000 Use signal instead of s for readability · matplotlib/matplotlib@5fe328e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5fe328e

Browse files
committed
Use signal instead of s for readability
1 parent baca32b commit 5fe328e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,17 @@ def __setstate__(self, state):
197197
s: {proxy: cid for cid, proxy in d.items()}
198198
for s, d in self.callbacks.items()}
199199

200-
def connect(self, s, func):
200+
@_api.rename_parameter("3.3.4", "s", "signal")
201+
def connect(self, signal, func):
201202
"""Register *func* to be called when signal *s* is generated."""
202-
self._func_cid_map.setdefault(s, {})
203+
self._func_cid_map.setdefault(signal, {})
203204
proxy = _weak_or_strong_ref(func, self._remove_proxy)
204-
if proxy in self._func_cid_map[s]:
205-
return self._func_cid_map[s][proxy]
205+
if proxy in self._func_cid_map[signal]:
206+
return self._func_cid_map[signal][proxy]
206207
cid = next(self._cid_gen)
207-
self._func_cid_map[s][proxy] = cid
208-
self.callbacks.setdefault(s, {})
209-
self.callbacks[s][cid] = proxy
208+
self._func_cid_map[signal][proxy] = cid
209+
self.callbacks.setdefault(signal, {})
210+
self.callbacks[signal][cid] = proxy< 469B /span>
210211
return cid
211212

212213
# Keep a reference to sys.is_finalizing, as sys may have been cleared out

0 commit comments

Comments
 (0)
0