[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Interpret #r"..." as a raw string
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] Interpret #r"..." as a raw string |
Date: |
Tue, 02 Mar 2021 10:11:18 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> I'm willing to believe it, but so far the only concrete examples I've
>> seen where raw string literals could be helpful are regexps.
>
> It's the most common use-case. The other is embedding conf files or
> source files in other languages (which is the same really, except
> there's no rx equivalent for those). It's pretty nice to be able to
> just dump some text verbatim (especially when copy pasting it from
> somewhere) with some special quotes at the start and at the end and
> not have to worry about it.
I'm sorry, but I can't quite see what you're talking about. Can you
point to existing code where there is such embedded "conf files or
source files" so we can better judge the potential benefit?
[ And in my experience "not have to worry about it" is an illusion:
you can never truly escape the need for escaping. ]
> I understand. I see some benefits with no cons.
If you don't see the cons, then indeed the tradeoff is clear ;-)
Stefan
Re: [PATCH] Interpret #r"..." as a raw string, Aurélien Aptel, 2021/03/02
Re: [PATCH] Interpret #r"..." as a raw string, Daniel Brooks, 2021/03/02
Re: [PATCH] Interpret #r"..." as a raw string, Stefan Monnier, 2021/03/02
Re: [PATCH] Interpret #r"..." as a raw string, Daniel Brooks, 2021/03/02
Re: [PATCH] Interpret #r"..." as a raw string, Andreas Schwab, 2021/03/03
Re: [PATCH] Interpret #r"..." as a raw string, Daniel Brooks, 2021/03/03
Re: [PATCH] Interpret #r"..." as a raw string, Andreas Schwab, 2021/03/03
Re: [PATCH] Interpret #r"..." as a raw string, Daniel Brooks, 2021/03/03