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

Skip to content

Commit c66a2a6

Browse files
committed
Remove some unnecessary calls to list().
1 parent 250c33e commit c66a2a6

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

examples/color/colormap_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
5252

5353
for ax, name in zip(axes, cmap_list):
5454
ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))
55-
pos = list(ax.get_position().bounds)
55+
pos = ax.get_position().bounds
5656
x_text = pos[0] - 0.01
5757
y_text = pos[1] + pos[3]/2.
5858
fig.text(x_text, y_text, name, va='center', ha='right', fontsize=10)

lib/matplotlib/backend_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class Cursors(object):
2727
"""Simple namespace for cursor reference"""
28-
HAND, POINTER, SELECT_REGION, MOVE, WAIT = list(range(5))
28+
HAND, POINTER, SELECT_REGION, MOVE, WAIT = range(5)
2929
cursors = Cursors()
3030

3131
# Views positions tool

lib/matplotlib/backends/qt_editor/formlayout.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,8 @@ def setup(self):
243243
elif isinstance(value, str):
244244
field = QtWidgets.QLineEdit(value, self)
245245
elif isinstance(value, (list, tuple)):
246-
if isinstance(value, tuple):
247-
value = list(value)
248-
selindex = value.pop(0)
249246
field = QtWidgets.QComboBox(self)
247+
selindex, *value = value
250248
if isinstance(value[0], (list, tuple)):
251249
keys = [key for key, _val in value]
252250
value = [val for _key, val in value]

0 commit comments

Comments
 (0)