diff --git a/jedi/plugins/stdlib.py b/jedi/plugins/stdlib.py index cae45ee5..d4928b23 100644 --- a/jedi/plugins/stdlib.py +++ b/jedi/plugins/stdlib.py @@ -28,6 +28,7 @@ from jedi.evaluate.context import iterable from jedi.evaluate.lazy_context import LazyTreeContext, LazyKnownContext, \ LazyKnownContexts from jedi.evaluate.syntax_tree import is_string +from jedi.evaluate.gradual.conversion import stub_to_actual_context_set # Copied from Python 3.6's stdlib. @@ -283,7 +284,13 @@ def builtins_reversed(sequences, obj, arguments): # necessary, because `reversed` is a function and autocompletion # would fail in certain cases like `reversed(x).__iter__` if we # just returned the result directly. - instance = TreeInstance(obj.evaluator, obj.parent_context, obj, ValuesArguments([])) + reversed_non_stub, = stub_to_actual_context_set(obj) + instance = TreeInstance( + obj.evaluator, + reversed_non_stub.parent_context, + reversed_non_stub, + ValuesArguments([]) + ) return ContextSet([ReversedObject(instance, list(reversed(ordered)))]) diff --git a/jedi/third_party/typeshed b/jedi/third_party/typeshed index 766ee7dd..38a7f146 160000 --- a/jedi/third_party/typeshed +++ b/jedi/third_party/typeshed @@ -1 +1 @@ -Subproject commit 766ee7dd8cc7c8c9c28482abed58357124b75ee6 +Subproject commit 38a7f14658377203c9c043daadf48641caa94980