[issue24047] str.startswith and str.endswith should accept multiple arguments.

Ethan Furman report at bugs.python.org
Fri Apr 24 08:03:42 CEST 2015


Ethan Furman added the comment:

We can already do

--> some_string.starts_with(('innie','minnie', 'minie', 'moe'))

Your proposal appears to be equivalent to:

--> 'test'.startswith(('a', 'b', 'c'))

How often do you check to see if a string starts with only a single character?

-1

tuple() is the correct solution to this problem.

----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24047>
_______________________________________


More information about the Python-bugs-list mailing list