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

Skip to content

Commit f1f66b0

Browse files
authored
Merge pull request #12051 from timhoffm/is-bool
Is bool
2 parents 0753e59 + cd01aa0 commit f1f66b0

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ def inner(ax, *args, data=None, **kwargs):
17301730
if not isinstance(label, str):
17311731
label = None
17321732

1733-
if (replace_names is None) or (replace_all_args is True):
1733+
if replace_names is None or replace_all_args:
17341734
# all should be replaced
17351735
args = tuple(_replacer(data, a) for
17361736
j, a in enumerate(args))

lib/matplotlib/backends/_backend_tk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ def _update_pointer_position(self, guiEvent=None):
334334
self.leave_notify_event(guiEvent)
335335

336336
def draw_idle(self):
337-
'update drawing area only if idle'
338-
if self._idle is False:
337+
"""Update the drawing area if idle."""
338+
if not self._idle:
339339
return
340340

341341
self._idle = False

lib/matplotlib/bezier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def split_path_inout(path, inside, tolerence=0.01, reorder_inout=False):
279279
path_out = Path(concat([verts_right, path.vertices[i:]]),
280280
concat([codes_right, path.codes[i:]]))
281281

282-
if reorder_inout and begin_inside is False:
282+
if reorder_inout and not begin_inside:
283283
path_in, path_out = path_out, path_in
284284

285285
return path_in, path_out

lib/matplotlib/tests/test_artist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_patch_transform_of_none():
3636
# Providing a transform of None puts the ellipse in device coordinates.
3737
e = mpatches.Ellipse(xy_pix, width=120, height=120, fc='coral',
3838
transform=None, alpha=0.5)
39-
assert e.is_transform_set() is True
39+
assert e.is_transform_set()
4040
ax.add_patch(e)
4141
assert isinstance(e._transform, mtransforms.IdentityTransform)
4242

@@ -51,10 +51,10 @@ def test_patch_transform_of_none():
5151
e = mpatches.Ellipse(xy_pix, width=120, height=120, fc='coral',
5252
alpha=0.5)
5353
intermediate_transform = e.get_transform()
54-
assert e.is_transform_set() is False
54+
assert not e.is_transform_set()
5555
ax.add_patch(e)
5656
assert e.get_transform() != intermediate_transform
57-
assert e.is_transform_set() is True
57+
assert e.is_transform_set()
5858
assert e._transform == ax.transData
5959

6060

lib/matplotlib/tests/test_legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def test_legend_title_empty():
494494
ax.plot(range(10))
495495
leg = ax.legend()
496496
assert leg.get_title().get_text() == ""
497-
assert leg.get_title().get_visible() is False
497+
assert not leg.get_title().get_visible()
498498

499499

500500
def test_legend_proper_window_extent():

0 commit comments

Comments
 (0)