(original) (raw)

On 23/08/06, Josiah Carlson <jcarlson@uci.edu> wrote:


...that looks to have been done by a script, it has inconsistant style
compared to the code it replaces, etc.

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:


try:
    i=str.index(foo)
except ValueError:
    i = -1

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.
--
Cheers,
Hasan Diwan <hasan.diwan@gmail.com>