Ref<PyType> (@NotNull final PyCallable callable, @NotNull TypeEvalContext context) { if (callable instanceof PyFunction function) { PySignature signature = PySignatureCacheManager.getInstance(function.getProject()).findSignature(function); if (signature != null && signature.getReturnType() != null) { final String typeName = signature.getReturnType().getTypeQualifiedName(); if (typeName != null) { final PyType type = PyTypeParser.getTypeByName(function, typeName, context); if (type != null) { return Ref.create(PyDynamicallyEvaluatedType.create(type)); } } } } return null; }