1
0
forked from VimPlug/jedi

Better typevar class comparisons

This commit is contained in:
Dave Halter
2018-09-03 00:58:10 +02:00
parent a28b179a45
commit 6bf21c4157
2 changed files with 21 additions and 3 deletions
+9 -2
View File
@@ -391,12 +391,19 @@ class TypeVar(_BaseTypingContext):
def get_filters(self, *args, **kwargs):
return iter([])
def execute_annotation(self):
def get_classes(self):
if self._bound_lazy_context is not None:
return self._bound_lazy_context.infer().execute_annotation()
return self._bound_lazy_context.infer()
if self._constraints_lazy_contexts:
return ContextSet.from_sets(
l.infer() for l in self._constraints_lazy_contexts
)
debug.warning('Tried to infer a TypeVar without a given type')
return NO_CONTEXTS
def execute_annotation(self):
return self.get_classes().execute_annotation()
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self.var_name)