[Python-3000] Droping find/rfind? (original) (raw)
Tim Peters tim.peters at gmail.com
Wed Aug 23 03:47:18 CEST 2006
- Previous message: [Python-3000] Droping find/rfind?
- Next message: [Python-3000] Droping find/rfind?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Guido van Rossum]
At today's sprint, one of the volunteers completed a patch to rip out find() and rfind(), replacing all calls with index()/rindex(). But now I'm getting cold feet -- is this really a good idea? (It's been listed in PEP 3100 for a long time, but I haven't thought about it much, really.)
What do people think?
I'd rather toss index/rindex myself, although I understand that [r]find's -1 return value for "not found" can trip up newbies. Like I care ;-)
If you decide to toss [r]find anyway, I'd rather see "not found" be spelled with an exception more specific than ValueError (who knows what all "except ValueError:" is going to catch? /Just/ that the substring wasn't found? Ya, that's something to bet your life on ;-)).
- Previous message: [Python-3000] Droping find/rfind?
- Next message: [Python-3000] Droping find/rfind?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]