On Thu, 17 Feb 2022 at 08:33, J.B. Langston <jblangs...@datastax.com> wrote:
>
> Well, I certainly sparked a lot of interesting discussion, which I have quite 
> enjoyed reading. But to bring this thread back around to its original topic, 
> is there support among the Python maintainers for adding a timeout feature to 
> the Python re library?  I will look at the third-party regex library that 
> Jonathan suggested but I still believe a timeout option would be a valuable 
> feature to have in the standard library.
>

I'm not a maintainer, but I'd personally be against a timeout. It
would add overhead to common cases in order to put a shield around
pathological ones, and it's difficult to impossible to usefully define
the cutoff. Instead, I'd recommend trying some of the simpler parsing
options, as explored in the ensuing discussion, to see if one of those
has better worst-case performance while still being able to do what's
needed. (Hence all the discussion of "no-backtracking" options.)

ChrisA
_______________________________________________
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/VTYADNIBL634JSAY4465DWRW3N5T6KMU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to