Python Forum

Full Version: suggested improvements.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
str.count(sub[,start[,end]]) should allow a tuple of strings for sub, such that it counts any of the non-overlapping strings in the tuple. 'abcdef'.count(('ab','de')) -> 2 str.endswith() and str.startswith() already accept tuples. why not lists, or sets, or frozensets. this could also be done for str.find(), str.index(), str.rfind(), and str.rindex().