[Python-bugs-list] [Bug #128711] Need string-to-character-list splitter
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 13 Jan 2001 18:36:33 -0800
Bug #128711, was updated on 2001-Jan-13 18:36
Here is a current snapshot of the bug.
Project: Python
Category: Python Library
Status: Open
Resolution: None
Bug Group: Feature Request
Priority: 5
Submitted by: brysmith
Assigned to : nobody
Summary: Need string-to-character-list splitter
Details: Python has many neat tools for string handling, but on eseems to
be missing -
to expand a string into a list of characters. Currently the code
lst = string.split("abcdef","")
returns "Value error - empty separator"
I would like to suggest that split with "" as the second argument be
interpreted as
a request to expand the first (string) argument into a list of the
characters that make up
the string.
e.g. string.split("ab c","") would return ['a', 'b', ' ', 'c']
This seems to make sense, since split(x,"") would then be the inverse of
join(y,"")
I doubt that this enhancement of string.split would break any existing
code, since
string.split("abc","") is currently an invalid call.
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=128711&group_id=5470