Message241912
| 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:07 | Elizacat | set | recipients:
+ Elizacat, vstinner, ezio.melotti |
| 2015年04月24日 05:49:07 | Elizacat | set | messageid: <1429854547.35.0.046111286022.issue24047@psf.upfronthosting.co.za> |
| 2015年04月24日 05:49:07 | Elizacat | link | issue24047 messages |
| 2015年04月24日 05:49:06 | Elizacat | create |
|