<br><br><div><span class="gmail_quote">On 8/22/06, <b class="gmail_sendername">Jack Diederich</b> &lt;<a href="mailto:jack@psynchronous.com">jack@psynchronous.com</a>&gt; 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>&gt; At today's sprint, one of the volunteers completed a patch to rip out<br>&gt; find() and rfind(), replacing all calls with index()/rindex(). But now
<br>&gt; I'm getting cold feet -- is this really a good idea? (It's been listed<br>&gt; in PEP 3100 for a long time, but I haven't thought about it much,<br>&gt; really.)<br>&gt;<br>&gt; What do people think?<br><br>Looking at my own code I use find() in two cases
<br><br>1) in an &quot;if&quot; clause where &quot;in&quot; or startswith() would be appropriate<br>&nbsp;&nbsp; This code was written when I started with python and is closer to<br>&nbsp;&nbsp; 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>&nbsp;&nbsp; would be even better.&nbsp;&nbsp;eg/<br>&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp; parts.append(text[text.index('himom')])<br>&nbsp;&nbsp; except ValueError: pass<br><br>This is 50 uses of find/rfind in 70 KLOCs of python.&nbsp;&nbsp;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.&nbsp; Let both exist.&nbsp; 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.&nbsp; 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>