Skip to content

Commit 9525f5f

Browse files
committed
Minor cleanup of constructor internals
1 parent 121413f commit 9525f5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

proplot/constructor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ def Norm(norm, *args, **kwargs):
896896
proplot.constructor.Colormap
897897
"""
898898
if np.iterable(norm) and not isinstance(norm, str):
899-
norm, args = norm[0], (*norm[1:], *args)
899+
norm, *args = *norm, *args
900900
if isinstance(norm, mcolors.Normalize):
901901
return norm
902902
if not isinstance(norm, str):
@@ -993,7 +993,7 @@ def Locator(locator, *args, **kwargs):
993993
if np.iterable(locator) and not isinstance(locator, str) and not all(
994994
isinstance(num, Number) for num in locator
995995
):
996-
locator, args = locator[0], (*locator[1:], *args)
996+
locator, *args = *locator, *args
997997
if isinstance(locator, mticker.Locator):
998998
return locator
999999
if isinstance(locator, str):
@@ -1130,7 +1130,7 @@ def Formatter(formatter, *args, date=False, index=False, **kwargs):
11301130
if np.iterable(formatter) and not isinstance(formatter, str) and not all(
11311131
isinstance(item, str) for item in formatter
11321132
):
1133-
formatter, args = formatter[0], (*formatter[1:], *args)
1133+
formatter, *args = *formatter, *args
11341134
if isinstance(formatter, mticker.Formatter):
11351135
return formatter
11361136
if isinstance(formatter, str):
@@ -1226,7 +1226,7 @@ def Scale(scale, *args, **kwargs):
12261226
# ScaleBase classes as arguments... but constructor functions cannot
12271227
# do anything but return the class instance upon receiving one.
12281228
if np.iterable(scale) and not isinstance(scale, str):
1229-
scale, args = scale[0], (*scale[1:], *args)
1229+
scale, *args = *scale, *args
12301230
if isinstance(scale, mscale.ScaleBase):
12311231
return scale
12321232
if not isinstance(scale, str):

0 commit comments

Comments
 (0)