(self, alias, args)
| 1094 | |
| 1095 | |
| 1096 | def _paramspec_prepare_subst(self, alias, args): |
| 1097 | params = alias.__parameters__ |
| 1098 | i = params.index(self) |
| 1099 | if i == len(args) and self.has_default(): |
| 1100 | args = (*args, self.__default__) |
| 1101 | if i >= len(args): |
| 1102 | raise TypeError(f"Too few arguments for {alias}") |
| 1103 | # Special case where Z[[int, str, bool]] == Z[int, str, bool] in PEP 612. |
| 1104 | if len(params) == 1 and not _is_param_expr(args[0]): |
| 1105 | assert i == 0 |
| 1106 | args = (args,) |
| 1107 | # Convert lists to tuples to help other libraries cache the results. |
| 1108 | elif isinstance(args[i], list): |
| 1109 | args = (*args[:i], tuple(args[i]), *args[i+1:]) |
| 1110 | return args |
| 1111 | |
| 1112 | |
| 1113 | @_tp_cache |
nothing calls this directly
no test coverage detected