This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Elizacat
Recipients Elizacat, ezio.melotti, vstinner
Date 2015-04-24.05:49:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429854547.35.0.046111286022.issue24047@psf.upfronthosting.co.za>
In-reply-to
Content
str.startswith and str.endswith should accept multiple arguments when passing in strings. This makes it easier to check if the first character of a string is one of a given option, versus this awkward construction:

>>> f = 'abc'
>>> 'test'.startswith(tuple(f))
False

With my proposal, this could be shortened to 'test'.startswith(*f) for easy testing.

This also makes it easier to check if a string begins with one of any combination of matches.
History
Date User Action Args
2015-04-24 05:49:07Elizacatsetrecipients: + Elizacat, vstinner, ezio.melotti
2015-04-24 05:49:07Elizacatsetmessageid: <1429854547.35.0.046111286022.issue24047@psf.upfronthosting.co.za>
2015-04-24 05:49:07Elizacatlinkissue24047 messages
2015-04-24 05:49:06Elizacatcreate