void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement expression = descriptor.getPsiElement(); if (expression instanceof PyTupleExpression) { PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project); PyExpressionStatement statement = elementGenerator.createFromText(LanguageLevel.forElement(expression), PyExpressionStatement.class, "(" + expression.getText() + ")"); expression.replace(statement.getExpression()); } }