Ref<PyType> (@NotNull PyCallable callable, @NotNull TypeEvalContext context) { final PsiElement pythonStub = PyiUtil.getPythonStub(callable); if (pythonStub instanceof PyCallable) { final PyType type = context.getReturnType((PyCallable)pythonStub); if (type != null) { return Ref.create(type); } } return null; }