Bryan Olson <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Steve Holden asked:
> > Do you just go round looking for trouble?
> 
> In the course of programming, yes, absolutly.
> 
> > As far as position reporting goes, it seems pretty clear that
> > find() will always report positive index values. In a
> > five-character string then -1 and 4 are effectively
> > equivalent. 
> >
> > What on earth makes you call this a bug?
> 
> What you just said, versus what the doc says.
> 
> > And what are you proposing that
> > find() should return if the substring isn't found at all?
> > please don't suggest it should raise an exception, as index()
> > exists to provide that functionality.
> 
> There are a number of good options. A legal index is not one of
> them.
> 
> 

Practically speaking, what difference would it make? Supposing find 
returned None for not-found. How would you use it in your code that 
would make it superior to what happens now? In either case you 
would have to test for the not-found state before relying on the 
index returned, wouldn't you? Or do you have a use that would 
eliminate that step?

-- 
rzed
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to