[Python-ideas] PEP 8: raw strings & regular expressions

Guido van Rossum guido at python.org
Mon Oct 26 00:07:51 EDT 2015


It's not going to be codified in PEP 8.

On Fri, Oct 23, 2015 at 11:18 AM, Barry Warsaw <barry at python.org> wrote:

> On Oct 22, 2015, at 06:56 PM, Yury Selivanov wrote:
>
> >In principle, there is no reason why *both* of these groups
> >of users can't use one tool and be happy.  I propose to
> >establish a convention in PEP 8, explaining that, while both
> >literals are semantically equivalent,
> >
> >- r'..' strings *should* be used for regexps,
> >
> >- R'..' strings *should* be used for unstyled raw strings,
> >
> >and tools *should* treat them as such.
> >
> >All of this is merely about codifying the current status quo.
>
> What about all the regexps that are written without raw strings?  Won't
> PEP 8
> codification shame everyone into turn them into raw strings when they
> really
> don't need to?
>
> Cheers,
> -Barry
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151025/56b73231/attachment-0001.html>


More information about the Python-ideas mailing list