python: inline a simple method

I don't think it adds much value!
This commit is contained in:
Ran Benita 2020-10-06 20:19:52 +03:00
parent 8ee6d0a866
commit 2ff88098a7
1 changed files with 2 additions and 5 deletions

View File

@ -922,10 +922,6 @@ class CallSpec2:
cs._idlist = list(self._idlist) cs._idlist = list(self._idlist)
return cs return cs
def _checkargnotcontained(self, arg: str) -> None:
if arg in self.params or arg in self.funcargs:
raise ValueError(f"duplicate {arg!r}")
def getparam(self, name: str) -> object: def getparam(self, name: str) -> object:
try: try:
return self.params[name] return self.params[name]
@ -947,7 +943,8 @@ class CallSpec2:
param_index: int, param_index: int,
) -> None: ) -> None:
for arg, val in zip(argnames, valset): for arg, val in zip(argnames, valset):
self._checkargnotcontained(arg) if arg in self.params or arg in self.funcargs:
raise ValueError(f"duplicate {arg!r}")
valtype_for_arg = valtypes[arg] valtype_for_arg = valtypes[arg]
if valtype_for_arg == "params": if valtype_for_arg == "params":
self.params[arg] = val self.params[arg] = val