How to create a raw string node name?
It seems that Node only accepts regular Python strings as a name, but not kdl RawStrings
Yes, RawStrings (and the other Value subclasses) are a type of value, suitable for an argument or a property value. I don't currently have any option to preserve the type of string used for a node name, or other non-value strings like tags or property names.
Currently my advice would be to stringify your object before passing it to Node's constructor. Do you have a reason to want to set one of the KDL types explicitly?
I already use a string of another format on the input side, but I don't want to see those ugly \" escapes everywhere when printing KDL in the converted output, that's why I wanted to pass RawString type (which I currently do by having a random node name and having a rawstring as an argument)
I've been considering switching to a "smart string choice" in the output (like I already have for deciding between printing as an ident or a string), so if there are " characters in the string I'll switch to using a raw string for output automatically. Would that be sufficient for you?
Yes, that would work, thank you!
Although I've just realized that for this specific use case it might not work (there is a risk that the converted comment string will clash with a valid non-comment command if put in the node name, so I better maintain add an explicit non-command node name like - , but that would still be a good addition since for some other property values/arguments I do use RawString just to get rid of \"