]> granicus.if.org Git - python/commit
Generalize operator.indexOf (PySequence_Index) to work with any
authorTim Peters <tim.peters@gmail.com>
Sat, 8 Sep 2001 04:00:12 +0000 (04:00 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 8 Sep 2001 04:00:12 +0000 (04:00 +0000)
commit16a77adfbd745c202878fabb0b921514fec7ca16
tree988fb5ffb34db1c7a12aa89c100efe1af17e80c6
parent2d84f2c95a59b815ef6864805bb6b04b79d0e106
Generalize operator.indexOf (PySequence_Index) to work with any
iterable object.  I'm not sure how that got overlooked before!

Got rid of the internal _PySequence_IterContains, introduced a new
internal _PySequence_IterSearch, and rewrote all the iteration-based
"count of", "index of", and "is the object in it or not?" routines to
just call the new function.  I suppose it's slower this way, but the
code duplication was getting depressing.
Include/abstract.h
Lib/test/test_iter.py
Misc/NEWS
Objects/abstract.c
Objects/classobject.c
Objects/typeobject.c