(self, other: Call, ctx)
| 974 | return signature.bind(*self.args, **kw) |
| 975 | |
| 976 | def match(self, other: Call, ctx) -> bool: |
| 977 | if type(other) != Call: |
| 978 | return False |
| 979 | if self.cached_full_name != other.cached_full_name: |
| 980 | return False |
| 981 | |
| 982 | for x in other.args: |
| 983 | if (type(x) == Constant and type(x.value) == type(...)) or type(x) == type(...): |
| 984 | is_wildcard = True |
| 985 | break |
| 986 | else: |
| 987 | is_wildcard = False |
| 988 | |
| 989 | if (not is_wildcard) and len(self.args) != len(other.args): |
| 990 | return False |
| 991 | else: |
| 992 | for idx, arg in enumerate(other.args): |
| 993 | if len(self.args) < idx: |
| 994 | if not ctx.match(arg, self.args[idx]): |
| 995 | return False |
| 996 | |
| 997 | for other_kwarg in other.kwargs.keys(): |
| 998 | if other_kwarg not in self.kwargs: |
| 999 | return False |
| 1000 | |
| 1001 | for name, val in self.kwargs.items(): |
| 1002 | if name not in other.kwargs: |
| 1003 | if is_wildcard: |
| 1004 | continue |
| 1005 | else: |
| 1006 | return False |
| 1007 | |
| 1008 | if not ctx.match(val, other.kwargs[name]): |
| 1009 | return False |
| 1010 | |
| 1011 | return True |
| 1012 | |
| 1013 | |
| 1014 | @dataclass |
no outgoing calls
no test coverage detected