<br><br><div><span class="gmail_quote">On 8/22/06, <b class="gmail_sendername">Jack Diederich</b> <<a href="mailto:jack@psynchronous.com">jack@psynchronous.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Aug 22, 2006 at 06:32:39PM -0700, Guido van Rossum wrote:<br>> At today's sprint, one of the volunteers completed a patch to rip out<br>> find() and rfind(), replacing all calls with index()/rindex(). But now
<br>> I'm getting cold feet -- is this really a good idea? (It's been listed<br>> in PEP 3100 for a long time, but I haven't thought about it much,<br>> really.)<br>><br>> What do people think?<br><br>Looking at my own code I use find() in two cases
<br><br>1) in an "if" clause where "in" or startswith() would be appropriate<br> This code was written when I started with python and is closer to<br> C++ or perl or was a literal translation of a snippet of C++ or perl
<br><br>2) where try/except around index() would work just fine and partition<br> would be even better. eg/<br> try:<br> parts.append(text[text.index('himom')])<br> except ValueError: pass<br><br>This is 50 uses of find/rfind in 70 KLOCs of python. Considering I would
<br>be better off not using find() in the places I do use it I would be happy<br>to see it go.<br><br>-Jack<br>_______________________________________________<br></blockquote></div><br>Even after reading Terry Reedy's arguments, I don't see why we need to
remove this option. Let both exist. I'd prefer grandfathering
something like this and leaving it in, even if it wouldn't be there had
known everything from the start. <br>
<br>
I just don't think its worth causing people grief in porting to Py3k
for something so trivial. I support fixing things in Py3k that are
real improvements, but this doesn't really seem like its worth the
trade off. <br>
<br>
- Brian<br>