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.

classification
Title: Clarify str.split() behavior
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: georg.brandl, ggenellina, jackdied, rhettinger
Priority: normal Keywords: patch

Created on 2009-10-24 04:33 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
stdtypes.diff ggenellina, 2009-10-24 04:33 Patch against trunk
Messages (3)
msg94401 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-10-24 04:33
Clarify str.split() behavior; see discussion at http://
comments.gmane.org/gmane.comp.python.general/641120
msg99874 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2010-02-22 23:30
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))
msg99881 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-02-22 23:51
Agreed.  Thanks Jack.
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51445
2010-02-22 23:51:51rhettingersetstatus: open -> closed
resolution: not a bug
messages: + msg99881
2010-02-22 23:30:58jackdiedsetnosy: + jackdied
messages: + msg99874
2009-10-24 06:05:19rhettingersetassignee: georg.brandl -> rhettinger

nosy: + rhettinger
2009-10-24 04:33:41ggenellinacreate