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

Skip to content

Remove superfluous list calls from around map #8991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, fig, *args, **kwargs):
else:
try:
s = str(int(args[0]))
rows, cols, num = list(map(int, s))
rows, cols, num = map(int, s)
except ValueError:
raise ValueError(
'Single argument to subplot must be a 3-digit '
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -2236,8 +2236,8 @@ def binary_repr(number, max_length=1025):
"""

# assert number < 2L << max_length
shifts = list(map(operator.rshift, max_length * [number],
range(max_length - 1, -1, -1)))
shifts = map(operator.rshift, max_length * [number],
range(max_length - 1, -1, -1))
digits = list(map(operator.mod, shifts, max_length * [2]))
if not digits.count(1):
return 0
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ def getpoints(self, x1, y1, x2, y2, k):
line and intersects (*x2*, *y2*) and the distance from (*x2*,
*y2*) of the returned points is *k*.
"""
x1, y1, x2, y2, k = list(map(float, (x1, y1, x2, y2, k)))
x1, y1, x2, y2, k = map(float, (x1, y1, x2, y2, k))

if y2 - y1 == 0:
return x2, y2 + k, x2, y2 - k
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axes_grid1/axes_divider.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def __init__(self, fig, *args, **kwargs):
else:
try:
s = str(int(args[0]))
rows, cols, num = list(map(int, s))
rows, cols, num = map(int, s)
except ValueError:
raise ValueError(
'Single argument to subplot must be a 3-digit integer')
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def autoscale(self, enable=True, axis='both', tight=None):
scalez=scalez)

def auto_scale_xyz(self, X, Y, Z=None, had_data=None):
x, y, z = list(map(np.asarray, (X, Y, Z)))
x, y, z = map(np.asarray, (X, Y, Z))
try:
x, y = x.flatten(), y.flatten()
if Z is not None:
Expand Down