1
0
forked from VimPlug/jedi

Refactor dict/set/list/tuple literal generic inferring

This commit is contained in:
Dave Halter
2018-09-27 00:01:35 +02:00
parent b5b0214c3c
commit 8e8271cf54
4 changed files with 28 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
from collections import defaultdict
from jedi import debug
from jedi.evaluate.utils import PushBackIterator
from jedi.evaluate import analysis
from jedi.evaluate.lazy_context import LazyKnownContext, \
@@ -49,9 +50,12 @@ class ExecutedParam(object):
# If we cannot infer annotations - or there aren't any - pretend
# that the signature matches.
return True
return any(c1.is_sub_class_of(c2)
for c1 in argument_contexts
for c2 in annotations)
matches = any(c1.is_sub_class_of(c2)
for c1 in argument_contexts
for c2 in annotations)
debug.dbg("signature compare %s: %s <=> %s",
matches, argument_contexts, annotations, color='BLUE')
return matches
@property
def var_args(self):