|
|
|
|
|
by bloobloobloo
3246 days ago
|
|
> What do you mean by "Python's quoting documentation" String literals are described by the following lexical definitions: stringliteral: shortstring | longstring
shortstring: "'" shortstringitem* "'" | '"' shortstringitem* '"'
longstring: "'''" longstringitem* "'''" | '"""' longstringitem* '"""'
shortstringitem: shortstringchar | escapeseq
longstringitem: longstringchar | escapeseq
shortstringchar: <any ASCII character except "\" or newline or the quote>
longstringchar: <any ASCII character except "\">
escapeseq: "\" <any ASCII character>
You can't paste that text into a file and write a Python program around it that outputs the same text. You need to encode the quote characters.More generally, there is no way in (many languages including) Python to treat an arbitrary (yet known) block of data as data. |
|
If you needed to have `」` in there you can fall back to `Q{{{{{{…}}}}}}` or `Q:to<END>;…END`