Message282925
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 :) |
|
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 | |
|