Message393892
| Author |
mrabarnett |
| Recipients |
Catherine.Devlin, Mark.Bell, Philippe Cloutier, ZackerySpytz, barry, cheryl.sabella, corona10, gvanrossum, karlcow, mrabarnett, serhiy.storchaka, syeberman, veky |
| Date |
2021年05月18日.17:38:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1621359500.72.0.0346964061331.issue28937@roundup.psfhosted.org> |
| In-reply-to |
| Content |
The best way to think of it is that .split() is like .split(' '), except that it's splitting on any whitespace character instead of just ' ', and keepempty is defaulting to False instead of True.
Therefore:
' x y z'.split(maxsplit=1, keepempty=True) == ['', ' x y z']
because:
' x y z'.split(' ', maxsplit=1) == ['', ' x y z']
but:
' x y z'.split(maxsplit=1, keepempty=False) == ['x y z']
At least, I think that's the case! |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2021年05月18日 17:38:20 | mrabarnett | set | recipients:
+ mrabarnett, gvanrossum, barry, syeberman, karlcow, serhiy.storchaka, Catherine.Devlin, Mark.Bell, veky, cheryl.sabella, corona10, ZackerySpytz, Philippe Cloutier |
| 2021年05月18日 17:38:20 | mrabarnett | set | messageid: <1621359500.72.0.0346964061331.issue28937@roundup.psfhosted.org> |
| 2021年05月18日 17:38:20 | mrabarnett | link | issue28937 messages |
| 2021年05月18日 17:38:20 | mrabarnett | create |
|