PsiElement (@NotNull PsiElement copy) { final PySequenceExpression sequence = unwrapCollection(copy); if (sequence instanceof PyTupleExpression) { final PyExpression[] elements = sequence.getElements(); if (elements.length == 1) { final PsiElement next = PyPsiUtils.getNextNonCommentSibling(elements[0], true); // Strictly speaking single element tuple must contain trailing comma, but lets check explicitly nonetheless if (next != null && next.getNode().getElementType() == PyTokenTypes.COMMA) { next.delete(); } } } return copy; }