On Sun, Oct 13, 2019, at 14:51, David Mertz wrote:
> I would not want to overload plain strings' .__contains__() method to 
> mean "has this substring OR matches this compiled regex." Besides being 
> on a likely performance path, it's too special. And what about glob 
> patterns, for example? Those too?

what about an "__rcontains__" method?

For glob patterns, those don't currently have an externally exposed 'compiled 
version' at all, and I assume if they ever gained one it would be a compiled 
regex (globs are translated to regex internally, and there is a private method 
called _compile_pattern which returns the compiled regex's .match method)
_______________________________________________
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/2FL6RVRJ3TQJ2IAWCARGQ3SREWFUKCHK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to