Message282925
| Author |
abarry |
| Recipients |
abarry, barry |
| Date |
2016年12月11日.15:26:42 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1481470002.63.0.941465466898.issue28937@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I understand the feeling. However, in a project I maintain, we want the other way around - to be able to never have an empty list, even if the string is empty (we resorted to using re.split in the end, which has this behaviour). Consider:
rest = re.split(" +", rest)[0].strip()
This gives us None-like behaviour in splitting, at the cost of not actually using str.split.
I'm +1 on the idea, but I'd like some way to better generalize str.split use (not everyone knows you can pass None and/or an integer).
(At the same time, the counter arguments where str has too many methods, or that methods shouldn't do too much, also apply here.)
But I don't like bikeshedding too much, so let's just count me as +1 for your way, if there's no strong momentum for mine :) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年12月11日 15:26:42 | abarry | set | recipients:
+ abarry, barry |
| 2016年12月11日 15:26:42 | abarry | set | messageid: <1481470002.63.0.941465466898.issue28937@psf.upfronthosting.co.za> |
| 2016年12月11日 15:26:42 | abarry | link | issue28937 messages |
| 2016年12月11日 15:26:42 | abarry | create |
|