Matthew Barnett <pyt...@mrabarnett.plus.com> added the comment:
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! ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue28937> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com