On Oct 8, 7:21 pm, greg <[EMAIL PROTECTED]> wrote:
> Terry Reedy wrote:
> > str.find is an historical anomaly that should not be copied.  It
> > was(is?) a wrapper for C's string find function.  C routinely uses -1 to
> > mean None for functions statically typed to return ints.  The Python
> > version logically should return None and usually does for other functions.
>
...
> [I]t can
> be inconvenient having a function that returns different
> types under different circumstances.
...

No.  It has precedent and there is no cost to convenience in pure
Python.

Perhaps you are passing the result straight to a C extension, and
parsing it straight to integer, but I can't attest to how common that
use case is.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to