Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de724f1 + 73371b0 commit 0da885aCopy full SHA for 0da885a
lib/matplotlib/backend_bases.py
@@ -1118,12 +1118,14 @@ def _timer_set_single_shot(self):
1118
def _on_timer(self):
1119
'''
1120
Runs all function that have been registered as callbacks. Functions
1121
- can return False if they should not be called any more. If there
+ can return False (or 0) if they should not be called any more. If there
1122
are no callbacks, the timer is automatically stopped.
1123
1124
for func, args, kwargs in self.callbacks:
1125
ret = func(*args, **kwargs)
1126
- if not ret:
+ # docstring above explains why we use `if ret == False` here,
1127
+ # instead of `if not ret`.
1128
+ if ret == False:
1129
self.callbacks.remove((func, args, kwargs))
1130
1131
if len(self.callbacks) == 0:
0 commit comments