Newbie question on Re module

Andrew McGregor andrew at indranet.co.nz
Sat Jan 4 20:00:28 CET 2003


Ah nuts, that should be str.index

--On Saturday, January 04, 2003 15:39:18 +0000 Tom Zych 
<tztemp14 at pobox.com> wrote:

> Andrew McGregor wrote:
>> if str.index('binaries') == -1:
>>   # then str did not contain the word.
>
> Python 2.2 doesn't return -1 when string.index fails; it raises
> a ValueError exception. Are there older versions of Python that
> return -1?
>
> --
> Tom Zych
> This email address will expire at some point to thwart spammers.
> Permanent address is rot13(gbzmlpu at cbobk.pbz).
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>







More information about the Python-list mailing list