Message241912
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. |
|
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 | |
|