String (@NotNull PyFunction function) { if (function.getAnnotation() != null && function.getAnnotation().getValue() != null) { return function.getAnnotation().getValue().getText(); } final PySignature signature = PySignatureCacheManager.getInstance(function.getProject()).findSignature(function); if (signature != null) { final String qualifiedName = signature.getReturnTypeQualifiedName(); if (qualifiedName != null) return qualifiedName; } return PyNames.OBJECT; }