[Python-ideas] What about regexp string litterals : re".*" ?

Nick Coghlan ncoghlan at gmail.com
Thu Mar 30 00:49:34 EDT 2017


On 28 March 2017 at 01:17, Simon D. <simon at acoeuro.com> wrote:
> It would ease the use of regexps in Python

We don't really want to ease the use of regexps in Python - while
they're an incredibly useful tool in a programmer's toolkit, they're
so cryptic that they're almost inevitably a maintainability nightmare.

Baking them directly into the language runtime also locks people in to
a particular regex engine implementation, rather than being able to
swap in a third party one if they choose to do so (as many folks
currently do with the `regex` PyPI module).

So it's appropriate to keep them as a string-based library level
capability, and hence on a relatively level playing field with less
comprehensive, but typically easier to maintain, options like string
methods and third party text parsing libraries (such as
https://pypi.python.org/pypi/parse for something close to the inverse
of str.format)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list