Message393892
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! |
|
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 | |
|