3 ms·
Triple quotes tend to come up for two purposes: 1. Long regular expression strings that have quote marks involved. I'm not a fan of large, complex regexes, but
by michaelochurch 13y ago
Triple quotes tend to come up for two purposes:
1. Long regular expression strings that have quote marks involved. I'm not a fan of large, complex regexes, but a lot of people dislike the line-noise added by escaping.
2. Docstrings that may have quotes in them.
It's to remove the string escaping that makes literals look different from the strings they describe.
- tobik 13y agoThanks. Thinking about it, I guess triple-quoted strings also facilitate doctests involving strings that would otherwise be really awkward to read/write.