Py-dea: Streamline string literals now!

Rick Johnson rantingrickjohnson at gmail.com
Tue Dec 27 23:36:35 EST 2011


On Dec 27, 10:17 pm, Chris Angelico <ros... at gmail.com> wrote:
> On Wed, Dec 28, 2011 at 2:49 PM, Rick Johnson
>
> <rantingrickjohn... 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.

Well that is but one of the proposals. The others include reducing
four combinations of string literals into one, and by default,
spanning multiple lines with one syntax.

> 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.

I am specifically referring to the Python language and how the
interpreter "interprets" string literals. Wait, you do share the same
definition of "string literal" as i do, i hope?

http://en.wikipedia.org/wiki/String_literal

> Python already has raw strings
> for the same reason (although the rules governing raw strings are
> oddly complex in edge cases).

Raw strings would be history with my proposal. No more need for raw
strings. This is the string literal to rule all string literals!

> Your proposal sounds like a good idea for a specific-situation config
> file, but a very bad idea for Python.

Can you give specific reasons why?



More information about the Python-list mailing list