Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
suggested improvements.
#1
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().
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What is ideal/suggested Python development setup on EC2 python300 3 1,210 Aug-20-2024, 12:08 AM
Last Post: Skaperen
  want suggested module for e-mail parsing Skaperen 0 2,029 Jul-26-2019, 08:52 PM
Last Post: Skaperen
  suggested change for all() and any() Skaperen 2 3,278 Aug-07-2018, 12:22 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020