Skip to content

Commit dbdb3b9

Browse files
committed
Remove unneeded condition in helper function
1 parent d8e37be commit dbdb3b9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ def figure_edit(axes, parent=None):
5959

6060
# Sorting for default labels (_lineXXX, _imageXXX).
6161
def cmp_key(label):
62-
if type(label) == tuple:
63-
label = label[0]
64-
match = re.match(r"(_line|_image)(\d+)", label)
62+
"""
63+
label should be a tuple consisting of the string label, and the object being sorted by label
64+
"""
65+
match = re.match(r"(_line|_image)(\d+)", label[0])
6566
if match:
6667
return match.group(1), int(match.group(2))
6768
else:
68-
return label, 0
69+
return label[0], 0
6970

7071
# Get / Curves
7172
labeled_lines = []

0 commit comments

Comments
 (0)