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

Skip to content

Commit 66270ba

Browse files
authored
Merge pull request #8991 from adeak/nolistmap_unpacking
Remove superfluous list calls from around map
2 parents 6582a9d + 66a5d93 commit 66270ba

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/matplotlib/axes/_subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, fig, *args, **kwargs):
4343
else:
4444
try:
4545
s = str(int(args[0]))
46-
rows, cols, num = list(map(int, s))
46+
rows, cols, num = map(int, s)
4747
except ValueError:
4848
raise ValueError(
4949
'Single argument to subplot must be a 3-digit '

lib/matplotlib/mlab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,8 +2236,8 @@ def binary_repr(number, max_length=1025):
22362236
"""
22372237

22382238
# assert number < 2L << max_length
2239-
shifts = list(map(operator.rshift, max_length * [number],
2240-
range(max_length - 1, -1, -1)))
2239+
shifts = map(operator.rshift, max_length * [number],
2240+
range(max_length - 1, -1, -1))
22412241
digits = list(map(operator.mod, shifts, max_length * [2]))
22422242
if not digits.count(1):
22432243
return 0

lib/matplotlib/patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ def getpoints(self, x1, y1, x2, y2, k):
13761376
line and intersects (*x2*, *y2*) and the distance from (*x2*,
13771377
*y2*) of the returned points is *k*.
13781378
"""
1379-
x1, y1, x2, y2, k = list(map(float, (x1, y1, x2, y2, k)))
1379+
x1, y1, x2, y2, k = map(float, (x1, y1, x2, y2, k))
13801380

13811381
if y2 - y1 == 0:
13821382
return x2, y2 + k, x2, y2 - k

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def __init__(self, fig, *args, **kwargs):
385385
else:
386386
try:
387387
s = str(int(args[0]))
388-
rows, cols, num = list(map(int, s))
388+
rows, cols, num = map(int, s)
389389
except ValueError:
390390
raise ValueError(
391391
'Single argument to subplot must be a 3-digit integer')

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def autoscale(self, enable=True, axis='both', tight=None):
470470
scalez=scalez)
471471

472472
def auto_scale_xyz(self, X, Y, Z=None, had_data=None):
473-
x, y, z = list(map(np.asarray, (X, Y, Z)))
473+
x, y, z = map(np.asarray, (X, Y, Z))
474474
try:
475475
x, y = x.flatten(), y.flatten()
476476
if Z is not None:

0 commit comments

Comments
 (0)