(self, alias, args)
| 1142 | |
| 1143 | |
| 1144 | def _paramspec_prepare_subst(self, alias, args): |
| 1145 | params = alias.__parameters__ |
| 1146 | i = params.index(self) |
| 1147 | if i == len(args) and self.has_default(): |
| 1148 | args = (*args, self.__default__) |
| 1149 | if i >= len(args): |
| 1150 | raise TypeError(f"Too few arguments for {alias}") |
| 1151 | # Special case where Z[[int, str, bool]] == Z[int, str, bool] in PEP 612. |
| 1152 | if len(params) == 1 and not _is_param_expr(args[0]): |
| 1153 | assert i == 0 |
| 1154 | args = (args,) |
| 1155 | # Convert lists to tuples to help other libraries cache the results. |
| 1156 | elif isinstance(args[i], list): |
| 1157 | args = (*args[:i], tuple(args[i]), *args[i+1:]) |
| 1158 | return args |
| 1159 | |
| 1160 | |
| 1161 | @_tp_cache |
nothing calls this directly
no test coverage detected
searching dependent graphs…