PsiElement (@NotNull PsiElement copy) { final PySequenceExpression sequenceExpression = unwrapCollection(copy); final PyExpression[] elements = sequenceExpression.getElements(); if (elements.length == 1) { final PyExpression onlyElement = elements[0]; final PsiElement next = PyPsiUtils.getNextNonCommentSibling(onlyElement, true); if (next != null && next.getNode().getElementType() != PyTokenTypes.COMMA) { final PyElementGenerator generator = PyElementGenerator.getInstance(copy.getProject()); final ASTNode anchor = onlyElement.getNode().getTreeNext(); sequenceExpression.getNode().addChild(generator.createComma(), anchor); } } return copy; }