forked from VimPlug/jedi
Allow unions when inferring annotations
This commit is contained in:
@@ -32,9 +32,9 @@ def infer_annotation(context, annotation):
|
|||||||
Also checks for forward references (strings)
|
Also checks for forward references (strings)
|
||||||
"""
|
"""
|
||||||
value_set = context.infer_node(annotation)
|
value_set = context.infer_node(annotation)
|
||||||
if len(value_set) != 1:
|
if len(value_set) == 0:
|
||||||
debug.warning("Inferred typing index %s should lead to 1 object, "
|
debug.warning(
|
||||||
" not %s" % (annotation, value_set))
|
"Inferred typing index %s should lead to 1 object, not %s" % (annotation, value_set))
|
||||||
return value_set
|
return value_set
|
||||||
|
|
||||||
inferred_value = list(value_set)[0]
|
inferred_value = list(value_set)[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user