File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1118,12 +1118,14 @@ def _timer_set_single_shot(self):
11181118 def _on_timer (self ):
11191119 '''
11201120 Runs all function that have been registered as callbacks. Functions
1121- can return False if they should not be called any more. If there
1121+ can return False (or 0) if they should not be called any more. If there
11221122 are no callbacks, the timer is automatically stopped.
11231123 '''
11241124 for func , args , kwargs in self .callbacks :
11251125 ret = func (* args , ** kwargs )
1126- if not ret :
1126+ # docstring above explains why we use `if ret == False` here,
1127+ # instead of `if not ret`.
1128+ if ret == False :
11271129 self .callbacks .remove ((func , args , kwargs ))
11281130
11291131 if len (self .callbacks ) == 0 :
You can’t perform that action at this time.
0 commit comments