8000 MNT: change from == False to == 0 · matplotlib/matplotlib@9b37674 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b37674

Browse files
committed
MNT: change from == False to == 0
https://docs.python.org/3/library/stdtypes.html#boolean-values This makes the linter happy and is no change in behavior.
1 parent e148def commit 9b37674

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,9 +1370,12 @@ def _on_timer(self):
13701370
'''
13711371
for func, args, kwargs in self.callbacks:
13721372
ret = func(*args, **kwargs)
1373-
# docstring above explains why we use `if ret == False` here,
1373+
# docstring above explains why we use `if ret == 0` here,
13741374
# instead of `if not ret`.
1375-
if ret == False:
1375+
# This will also catch `ret == False` as `False == 0`
1376+
# but does not annoy the linters
1377+
# https://docs.python.org/3/library/stdtypes.html#boolean-values
1378+
if ret == 0:
13761379
self.callbacks.remove((func, args, kwargs))
13771380

13781381
if len(self.callbacks) == 0:

0 commit comments

Comments
 (0)
0