[Python-Dev] Re: PEP 295 - Interpretation of multiline string constants

Delaney, Timothy tdelaney@avaya.com
Fri, 26 Jul 2002 08:27:23 +1000


> From: Michael Chermside [mailto:mcherm@destiny.com]
>
> In conclusion, I propose you use simpler methods available WITHIN the 
> language for solving this problem, rather than proposing a 
> PEP to modify 
> the language itself.

In fact, the simplest mechanism is to declare all multi-line string literals
at module scope.

Presumably all such literals are supposed to be constants (docstrings are a
special exception, but there are already rules for those in terms of how
they should be displayed).

This is a highly incompatible change with very high risk of breaking code.
This is not a -1 or some such - this is a "cannot even be considered unless
you can make it backwards compatible with all uses of multiline strings"
which is of course impossible (since the whole purpose of the PEP is to
modify such strings).

When I first read this PEP I thought it was something that had been
suggested to someone, and it was being proposed in order to be rejeted. It's
obvious from later posts that that is not the case, and Stepan is having
trouble understanding why such a PEP would be rejected out of hand.

You might find support for a library function which performed the
transformation that you desire (if there's a good enough use case for it).
Personally, I don't think there is - too many times that one particular
transformation will be "almost, but not quite what I want" in which case I
need to roll my own anyway.

Tim Delaney