void (PsiElement expression, PyElementGenerator elementGenerator) { final StringBuilder stringBuilder = new StringBuilder("print("); final PyFile file = (PyFile)expression.getContainingFile(); final PyExpression[] target = PsiTreeUtil.getChildrenOfType(expression, PyExpression.class); if (target != null) { stringBuilder.append(StringUtil.join(target, o -> o.getText(), ", ")); } stringBuilder.append(")"); expression.replace(elementGenerator.createFromText(LanguageLevel.forElement(expression), PyElement.class, stringBuilder.toString())); AddImportHelper.addOrUpdateFromImportStatement(file, "__future__", "print_function", null, AddImportHelper.ImportPriority.FUTURE, null); }