
5 Oct
2011
5 Oct
'11
3:06 p.m.
Ron Adam wrote:
I really don't like the '-1' for a not found case. They just get in the way.
If len(s) was the not found case, you get a value that can be used in a slice without first checking the index, or catching an exception.
So every time we want to know if s.find() failed, we have to compare to len(s)?
No thanks.
~Ethan~