]> granicus.if.org Git - python/commit
Now in find, rfind, index, and rindex, you can use None as defaults,
authorFacundo Batista <facundobatista@gmail.com>
Fri, 16 Nov 2007 18:04:14 +0000 (18:04 +0000)
committerFacundo Batista <facundobatista@gmail.com>
Fri, 16 Nov 2007 18:04:14 +0000 (18:04 +0000)
commit57d5669f4be86fcaf21f95436fcd5142ffe5efae
tree332a4d0e4f0069b55af028ade293def34622954f
parent5397fd1a51d2f5bbb9ca1f5a385538e6072ced26
Now in find, rfind, index, and rindex, you can use None as defaults,
as usual with slicing (both with str and unicode strings).  This
fixes issue 1259.

For str only the stringobject.c file was modified.  But for unicode,
I needed to repeat in the four functions a lot of code, so created
a new function that does part of the job for them (and placed it in
find.h, following a suggestion of Barry).

Also added tests for this behaviour.
Lib/test/string_tests.py
Objects/stringlib/find.h
Objects/stringobject.c
Objects/unicodeobject.c