[Python-ideas] contains_any_in and contains_all_in

João Matos jcrmatos at gmail.com
Wed Apr 24 12:50:56 EDT 2019


The objective of the proposal is to increase readability.
IMO using re is even more unreadable than the and/or or any/all I mentioned.


quarta-feira, 24 de Abril de 2019 às 05:47:04 UTC+1, Robert Vanden Eynde 
escreveu:
>
> Trivial with re module, which will answer thequestion in one pass.
>>
>
> re.search('|'.join(map(re.escape, ['string1', 'string2', 'string3'])), 
> master_string)
>
> For those who might find it non trivial.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190424/aab3893f/attachment.html>


More information about the Python-ideas mailing list