[Python-3000] find -> index patch
Gareth McCaughan
gmccaughan at synaptics-uk.com
Thu Aug 24 16:21:11 CEST 2006
Fredrik Lundh wrote:
> note that partition provides an elegant solution to an important *subset* of all
> problems addressed by find/index.
>
> just like lexical scoping vs. default arguments and map vs. list comprehensions,
> it doesn't address all problems right out of the box, and shouldn't be advertised
> as doing that.
Sure, but partition + "in" (now that it works as an arbitrary substring test)
seem to cover a very large subset of the things you'd want to do with find:
enough that having only index available for the remaining cases is unlikely
to hurt much (apart from the important issue of backward compatibility, but
this *is* py3k). I'm having trouble thinking of any plausible counterexamples,
though I'm sure there must be some.
--
g
More information about the Python-3000
mailing list