> > It’s unfortunate that these functions aren’t better matched. Why is there > a simple-semantics find-everything and a match-semantics find-iteratively > and find-one? But I don’t think adding a simple-semantics find-one that > works by inefficiently finding all is the right solution. >
The proposed implementation for *findfirst()* is: *return next(finditer(pattern, text, flags=flags), default=default)* > And if the point of proposing first is that novices will figure out how to > write first(findall(…)) so we don’t need to add findfirst, then I think we > need findfirst even more, because novices shouldn’t learn that bad idea. > I posted another thread to argue in favor of *first()*, independently of *findfirst().* -- Juancarlo *Añez*
_______________________________________________ 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/ISBWUONTALYR4JPS3F6ESB3KJBHGLRES/ Code of Conduct: http://python.org/psf/codeofconduct/