kenhuuu commented on code in PR #3401:
URL: https://github.com/apache/tinkerpop/pull/3401#discussion_r3169274627


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/PythonTranslateVisitor.java:
##########
@@ -289,6 +289,42 @@ public Void visitUuidLiteral(final 
GremlinParser.UuidLiteralContext ctx) {
         return null;
     }
 
+    @Override
+    public Void visitCharacterLiteral(final 
GremlinParser.CharacterLiteralContext ctx) {
+        final String text = ctx.getText();
+        final String withoutSuffix = text.substring(0, text.length() - 1);
+        final String inner = removeFirstAndLastCharacters(withoutSuffix);
+        sb.append("SingleChar('").append(inner).append("')");

Review Comment:
   Yes this works. But you are actually pointing out an inconsistency that I 
didn't mention. Java/.NET/Go output the value wrapped in "" by default, but 
JavaScript and Python wrap in ''. So there is a bit of an inconsistency there. 
The grammar, however, accepts both, so even when repr() swaps from ' to ", it 
still works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to