[issue7196] Clarify str.split() behavior

Jack Diederich report at bugs.python.org
Tue Feb 23 00:30:59 CET 2010


Jack Diederich <jackdied at gmail.com> added the comment:

I suggest this be closed WONTFIX.  The str.split() documentation accurately describes str.split() but doesn't happen to do what the OP wanted which was

list(filter(None, '00010001'.split('0')))

Instead split(sep) is the reciprocal of sep.join(), that is
txt == sep.join(txt.split(sep))

----------
nosy: +jackdied

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


More information about the Python-bugs-list mailing list