On Tue, 29 Sep 2020 at 04:39, <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2020-09-28 at 23:10:24 -0000,
> Giang Le <giang.lh0...@gmail.com> wrote:
>
> > I would like to propose an idea for the regular expression module
> > re.search(Pattern, Input) to support List[str] input type.
>
> > So it will return a matched object list if the input is a string
> > list. Otherwise, it will return a normal matched object, if the input
> > is a normal string
>
> How would that change be better than a new function:
>
>     def regex_search_list(regex, pattern, list_of_inputs):
>         [regex.search(pattern, input) for input in list_of_inputs]
>
> (or possibly an equivalent method of regexen)?

I suppose that another advantage is that the list is passed to C, so
it's faster.
Not sure such an overloading is desirable.
_______________________________________________
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/LDYHQEKW776JISFA6FNBGETVUCUW2KQT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to