List<Object> () { final PsiFile file = myElement.getContainingFile(); final List<Object> variants = Lists.newArrayList(PyNames.TYPE_STR, PyNames.TYPE_INT, "basestring", "bool", "buffer", "bytearray", "complex", "dict", "tuple", "enumerate", "file", "float", "frozenset", "list", PyNames.TYPE_LONG, "set", "object"); if (file instanceof PyFile) { variants.addAll(((PyFile)file).getTopLevelClasses()); final List<PyFromImportStatement> fromImports = ((PyFile)file).getFromImports(); for (PyFromImportStatement fromImportStatement : fromImports) { final PyImportElement[] elements = fromImportStatement.getImportElements(); for (PyImportElement element : elements) { final PyReferenceExpression referenceExpression = element.getImportReferenceExpression(); if (referenceExpression == null) continue; final PyType type = TypeEvalContext.userInitiated(file.getProject(), CompletionUtilCoreImpl .getOriginalOrSelf(file)).getType(referenceExpression); if (type instanceof PyClassType) { variants.add(((PyClassType)type).getPyClass()); } } } } return variants; }