This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:20mrabarnettsetrecipients: + mrabarnett, gvanrossum, barry, syeberman, karlcow, serhiy.storchaka, Catherine.Devlin, Mark.Bell, veky, cheryl.sabella, corona10, ZackerySpytz, Philippe Cloutier
2021-05-18 17:38:20mrabarnettsetmessageid: <1621359500.72.0.0346964061331.issue28937@roundup.psfhosted.org>
2021-05-18 17:38:20mrabarnettlinkissue28937 messages
2021-05-18 17:38:20mrabarnettcreate