Py-dea: Streamline string literals now!

Chris Angelico rosuav at gmail.com
Tue Dec 27 23:17:30 EST 2011


On Wed, Dec 28, 2011 at 2:49 PM, Rick Johnson
<rantingrickjohnson at gmail.com> wrote:
> My proposal is to introduce a single delimiter for string literals. A
> new string literal that is just as good at spanning single lines as it
> is spanning multiple lines. A new literal that uses widely known
> markup tag syntax instead of cryptic and noisy escape sequences. And
> finally, a *literal* that is worthy of the 21st century.

So all you're doing is introducing a different form of escaping. You
can already achieve this with regular expressions in several engines -
declare a different delimiter and/or escape character - in order to
dodge the issue of multiple escapes. Python already has raw strings
for the same reason (although the rules governing raw strings are
oddly complex in edge cases).

Your proposal sounds like a good idea for a specific-situation config
file, but a very bad idea for Python. If you want elaboration on that,
ask me for my arguments on CSV vs /etc/passwd. Or search the web for
the same topic, I'm sure many others have made the same points.

ChrisA



More information about the Python-list mailing list