Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90c2228

Browse files
Simplify BoundMethodSignature.check_call (#457)
1 parent 4a73f34 commit 90c2228

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

pycroscope/signature.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,32 +2985,7 @@ class BoundMethodSignature:
29852985
return_override: Value | None = None
29862986

29872987
def check_call(self, args: Iterable[Argument], ctx: CheckCallContext) -> Value:
2988-
self_composite = self.self_composite
2989-
has_impl = (
2990-
self.signature.impl is not None
2991-
if isinstance(self.signature, Signature)
2992-
else any(sig.impl is not None for sig in self.signature.signatures)
2993-
)
2994-
if not has_impl:
2995-
normalized_value = self_composite.value
2996-
if isinstance(normalized_value, SequenceValue) and normalized_value.typ in (
2997-
list,
2998-
set,
2999-
):
3000-
normalized_value = normalized_value.simplify()
3001-
elif isinstance(normalized_value, DictIncompleteValue):
3002-
normalized_value = normalized_value.simplify()
3003-
elif isinstance(normalized_value, KnownValue):
3004-
replaced = replace_known_sequence_value(normalized_value)
3005-
if isinstance(replaced, SequenceValue) and replaced.typ in (list, set):
3006-
normalized_value = replaced.simplify()
3007-
elif isinstance(replaced, DictIncompleteValue):
3008-
normalized_value = replaced.simplify()
3009-
if normalized_value != self_composite.value:
3010-
self_composite = Composite(
3011-
normalized_value, self_composite.varname, self_composite.node
3012-
)
3013-
ret = self.signature.check_call([(self_composite, None), *args], ctx)
2988+
ret = self.signature.check_call([(self.self_composite, None), *args], ctx)
30142989
if self.return_override is not None and not self.signature.has_return_value():
30152990
if isinstance(ret, AnnotatedValue):
30162991
return annotate_value(self.return_override, ret.metadata)

0 commit comments

Comments
 (0)