[Python-ideas] raw strings
Guido van Rossum
guido at python.org
Mon Oct 1 22:39:46 CEST 2007
(Clark: I don't want to discuss this offline. On the list it goes.)
Quote doubling isn't a viable option for Python -- I don't believe
it's sane to have both backslashes and quote-double as escape
Of course in C# the trailing \ is the main use case -- after all it's
a Microsoft product.
While for some Windows users this may be a nuisance, I don't think
they are in the majority amongst Python users.
On 10/1/07, Clark Maurer <cmaurer at slickedit.com> wrote:
> I'll do what I can to sway you.
> Guido, please....pretty please with sugar on top (hehehe). I've been
> spoiled with languages which do better raw string. I designed Slick-C
> which I've been using for years and it does not have this problem. I
> always type Windows paths using the Slick-C equivalent of raw strings.
> My implementation came from REXX (I'm no spring chicken- I think you've
> heard of it too :-). Now that C# has gone with this implementation, that
> pretty much makes it the modern way to do this. C# has a lot more clout
> than Slick-C. Yes, these style strings are intended for regexes AND
> Windows paths. Just think, you can get rid of one FAQ. It's easier to
> document. The down side is that there will be some backward
> compatibility issues. I will admit, compared to other issues this is a
> small one.
> Trailing backslash isn't the only problem but it's the bigger one. Two
> quotes should be one single quote. Otherwise, specifying both quote
> characters in regexes is an issue. Yes, I've done this in regular
> expressions. This change could cause some backward compatibility
> problems as well.
> -----Original Message-----
> From: python-ideas-bounces at python.org
> [mailto:python-ideas-bounces at python.org] On Behalf Of Guido van Rossum
> Sent: Monday, October 01, 2007 3:54 PM
> To: Steven Bethard
> Cc: Python-Ideas
> Subject: Re: [Python-ideas] raw strings
> On 10/1/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> > > On 10/1/07, Steven Bethard <steven.bethard at gmail.com> wrote:
> > > > On 10/1/07, Clark Maurer <cmaurer at slickedit.com> wrote:
> > > > > The current implementation doesn't allow for a trailing
> backslash in the
> > > > > string.
> > > >
> > > > I believe that will change in Python 3.0.
> > > >
> > > > The discussion is here:
> > > > http://mail.python.org/pipermail/python-3000/2007-May/007684.html
> > > >
> > > > And Ron Adam's current patch is here:
> > > > http://bugs.python.org/issue1720390
> > On 10/1/07, Guido van Rossum <guido at python.org> wrote:
> > > I'm still against actually. That's why the patch hasn't been applied
> > Sorry, my mistake. I read the thread as being somewhat in support of
> the change.
> I admit I've been wobbling a lot on this.
> > Anyway, to the OP, if you want to make this happen, you should help
> > Ron out with his patch. (Code has a much better chance of convincing
> > Guido than anything else does.)
> Not in this case. It's more the philosophical distinction -- are raw
> strings meant primarily to hold regexes or Windows pathnames? These
> two use cases have opposite requirements for trailing backslash
> treatment. I know the original use case that caused them to be added
> to the language is regexes, and that's still the only one I use on a
> regular basis.
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> Python-ideas mailing list
> Python-ideas at python.org
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-ideas