(
self,
*,
valtypes: Mapping[str, "Literal['params', 'funcargs']"],
argnames: Iterable[str],
valset: Iterable[object],
id: str,
marks: Iterable[Union[Mark, MarkDecorator]],
scope: Scope,
param_index: int,
)
| 948 | marks: List[Mark] = attr.Factory(list) |
| 949 | |
| 950 | def setmulti( |
| 951 | self, |
| 952 | *, |
| 953 | valtypes: Mapping[str, "Literal['params', 'funcargs']"], |
| 954 | argnames: Iterable[str], |
| 955 | valset: Iterable[object], |
| 956 | id: str, |
| 957 | marks: Iterable[Union[Mark, MarkDecorator]], |
| 958 | scope: Scope, |
| 959 | param_index: int, |
| 960 | ) -> "CallSpec2": |
| 961 | funcargs = self.funcargs.copy() |
| 962 | params = self.params.copy() |
| 963 | indices = self.indices.copy() |
| 964 | arg2scope = self._arg2scope.copy() |
| 965 | for arg, val in zip(argnames, valset): |
| 966 | if arg in params or arg in funcargs: |
| 967 | raise ValueError(f"duplicate {arg!r}") |
| 968 | valtype_for_arg = valtypes[arg] |
| 969 | if valtype_for_arg == "params": |
| 970 | params[arg] = val |
| 971 | elif valtype_for_arg == "funcargs": |
| 972 | funcargs[arg] = val |
| 973 | else: |
| 974 | assert_never(valtype_for_arg) |
| 975 | indices[arg] = param_index |
| 976 | arg2scope[arg] = scope |
| 977 | return CallSpec2( |
| 978 | funcargs=funcargs, |
| 979 | params=params, |
| 980 | arg2scope=arg2scope, |
| 981 | indices=indices, |
| 982 | idlist=[*self._idlist, id], |
| 983 | marks=[*self.marks, *normalize_mark_list(marks)], |
| 984 | ) |
| 985 | |
| 986 | def getparam(self, name: str) -> object: |
| 987 | try: |
no test coverage detected