On Tue, Mar 29, 2022 at 4:08 PM Steven D'Aprano <st...@pearwood.info> wrote:


> I have no strong opinion on whether this simple function should be built
> into the string class,


I do -- this is not sufficiently general to be a string method.


> but I do have a strong opinion about re-writing
> it into a slower, more fragile, harder to understand, less user-friendly
> regex.
>

I do agree there.

I also agree with Chris A's suggestion:

*some* scanner / parser that could be used for this and many other things
that's significantly more straightforward that regex's.

-CHB


-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LOHHZQD2ZPAZL52OLOWIB5IBCFQQH6KN/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to