On Fri, Feb 21, 2020 at 10:19:37PM -0500, David Mertz wrote:
On Fri, Feb 21, 2020 at 9:26 PM Steven D'Aprano firstname.lastname@example.org wrote:
And what's so special about SQL over, say, regular expressions, XML, JSON, YAML, Markdown, ReST, LaTeX, etc? I might want to use the s'' prefix for embedded Scheme code rather than SQL.
Um, regular expressions are not precisely the best example there, since we do have raw strings specifically for regular expressions.
I mentioned them also in my similar list, but deliberately. *Raw strings* are not per-se for regexen, even if that is one of the more common uses.
Actually, in Python, regexes are the primary reason raw strings were added!
Raw strings aren't quite fully raw, which is why you can't use raw strings for Windows paths:
path = r'somewhere\some\folder'
doesn't work. The reason is that "raw" (semi-cooked?) strings are intended for regexes, not as a general mechanism for disabling string escape codes, and regexes aren't allow to end with a bare backslash.