Stupid string.split question

Batista, Facundo FBatista at uniFON.com.ar
Wed Aug 6 16:43:07 EDT 2003


#- Is there any conceptual reason why
#- 
#- "ABCDEF".split("") shouldn't equal ["A", "B", "C", "D", "E", "F"]?
#- 
#- The error says empty seperator, but the result makes sense 
#- given that 
#- fact and the fact that:
#- 
#- "".join(["A", "B", "C", "D", "E", "F"]) == "ABCDEF"
#- 
#- It seems that if you can join with an empty seperator, you should be 
#- able to split with one.

Beyond any particular reason, or a better way to do it, seems nice to me to
be able to split with empty separator, just to thin of join and split as
"complementary" functions (but that's just my opinion).

.	Facundo





More information about the Python-list mailing list