[Python-Dev] string.find() again (was Re: timsort for jython)

Bjorn Pettersen BPettersen@NAREX.com
Mon, 5 Aug 2002 13:00:27 -0600


> From: Tim Peters [mailto:tim.one@comcast.net]=20
>=20
> [Guido]
> > ...
> > I don't like exists().  Maybe we should finally implement=20
> "s1 in s2"=20
> > as "s2.find(s1) >=3D 0", i.e. add a __contains__ method to strings?
>=20
> I asked you about that a few weeks ago, and you were=20
> agreeable.  I posted that info to c.l.py, saying that if=20
> anyone cared enough to submit a patch, the idea was=20
> pre-approved.  AFAIK, nobody bit (but I didn't pay much=20
> attention to patches last week -- hope springs eternal <wink>).

Well, there was
http://groups.google.com/groups?q=3DBjorn+PyUnicode+group:comp.lang.pytho=
n
&hl=3Den&lr=3D&ie=3DUTF-8&oe=3DUTF-8&selm=3Dmailman.1024100114.13008.pyth=
on-list%4
0python.org&rnum=3D1.

I'll see if I can find time next weekend to figure out the compilation
warnings, adding back special casing for single char containment, and
adding test and doc patches...

-- bjorn