PyStringLiteralExpression (@NotNull StringLiteralExpression oldElement, @NotNull String unescaped) { Pair<String, String> quotes = PyStringLiteralCoreUtil.getQuotes(oldElement.getText()); if (quotes != null) { return createStringLiteralAlreadyEscaped(quotes.first + unescaped + quotes.second); } else { return createStringLiteralFromString(unescaped); } }