[issue28937] str.split(): remove empty strings when sep is not None

Serhiy Storchaka report at bugs.python.org
Sun Dec 11 10:32:40 EST 2016


Serhiy Storchaka added the comment:

Current behavior is consistent with str.count():

    len(string.split(sep)) == string.count(sep) + 1

and re.split():

    re.split(re.escape(sep), string) == string.split(sep)

May be the behavior when sep is None should be changed for consistency with the behavior when sep is not None?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28937>
_______________________________________


More information about the Python-bugs-list mailing list