[Python-3000] find -> index patch

Jack Diederich jack at psynchronous.com
Wed Aug 23 23:39:25 CEST 2006


On Wed, Aug 23, 2006 at 02:18:59PM -0700, Guido van Rossum wrote:
> Here's the patch (by Hasan Diwan, BTW) for people's perusal. It just
> gets rid of all *uses* of find/rfind from Lib; it doesn't actually
> modify stringobject.c or unicodeobject.c. It doesn't use
> [r]partition()'; someone could look for opportunities to use that
> separately.
> 

Is this a machine generated patch?  Changing all calls to find with
  try: i = text.index(sep)
  except: i = -1
has a Yuck factor of -1000.  Some of the excepts specify ValueError,
but still.   

-Jack


More information about the Python-3000 mailing list