On 23/08/06, <b class="gmail_sendername">Josiah Carlson</b> &lt;<a href="mailto:jcarlson@uci.edu">jcarlson@uci.edu</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
...that looks to have been done by a script, it has inconsistant style<br>compared to the code it replaces, etc.<br></blockquote></div><br>I made the minimal change that implements the functionality suggested, in terms of find/rfind, they return -1. The least painful way to replace it with index is:
<br><br>try: <br>&nbsp;&nbsp;&nbsp; i=str.index(foo)<br>except ValueError:<br>&nbsp; &nbsp; i = -1<br><br>As for the plain except clauses, that was just laziness on my part. It's not meant to be stylistically consistent or beautiful, rather it is meant to be functional and as a starting point. Feel free to change/rewrite the patch. The GENERAL CASE, 
i.e. one that is applicable throughout the code is the try/except clauses shown above. <br>-- <br>Cheers,<br>Hasan Diwan &lt;<a href="mailto:hasan.diwan@gmail.com">hasan.diwan@gmail.com</a>&gt;