Another Wart! string.find() [ was: namespace issue? ]

Chuck Esterbrook ChuckEsterbrook at yahoo.com
Fri Jun 22 14:58:12 EDT 2001


"Tim Peters" <tim.one at home.com> wrote in message 
news:<mailman.993232174.31673.python-list at python.org>...
>[Chris Barker]
> > Returning -1 was an unfortunate choice for two reasons:
> >
> > it is not a false value
> >
> > it is a valid index into a string
>Historical note:  at the time these functions were designed, negative
>indices were not allowed:  sequence[negative_int] raised an exception.
>Allowing the latter was a later addition to the language, and was a mixed
>blessing (for this and other reasons; but I think it was a net win).

I would be interested to know what other things besides the -1 from find() 
were a minus for negative indices...?


> > This is all kind of useless discussion however as string.find is
> > in far too much code as it is.
>Yup:  learn to love it, or be killed <wink>.
> > Besides, it really isn't all that bad anyway.
>Indeed, *most* endless threads are about things that don't matter <wink>.

That's because they are easy to talk about.  ;-)

I discuss such things because I'm interested in language design and Python 
is closest to what I would consider ideal.


-Chuck





More information about the Python-list mailing list