Mark Bell <[email protected]> added the comment:
> suggests that empty strings don't count towards maxsplit
Thank you for the confirmation. Although just to clarify I guess you really
mean "empty strings *that are dropped from the output* don't count towards
maxsplit". Just to double check this, what do we expect the output of
' x y z'.split(maxsplit=1, keepempty=True)
to be?
I think it should be ['', ' x y z'] since in this case we are retaining empty
strings and they should count towards the maxsplit.
(In the current patch this crashes with a core dump since it tries to write to
unallocated memory)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue28937>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com