Skip to content

Commit da84169

Browse files
committed
Simplify args tuple creation
1 parent 4bd37c0 commit da84169

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Lib/typing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ def _paramspec_prepare_subst(self, alias, args):
11001100
params = alias.__parameters__
11011101
i = params.index(self)
11021102
if i == len(args) and self.has_default():
1103-
args = [*args, self.__default__]
1103+
args = (*args, self.__default__)
11041104
if i >= len(args):
11051105
raise TypeError(f"Too few arguments for {alias}")
11061106
# Special case where Z[[int, str, bool]] == Z[int, str, bool] in PEP 612.
@@ -1110,8 +1110,6 @@ def _paramspec_prepare_subst(self, alias, args):
11101110
# Convert lists to tuples to help other libraries cache the results.
11111111
elif isinstance(args[i], list):
11121112
args = (*args[:i], tuple(args[i]), *args[i+1:])
1113-
else:
1114-
args = tuple(args)
11151113
return args
11161114

11171115

0 commit comments

Comments
 (0)