a splitting headache

John Posner jjposner at optimum.net
Thu Oct 22 17:05:39 CEST 2009


Carl Banks wrote:

<snip>
> s.split() and s.split(sep) do different things, and there is no string
> sep that can make s.split(sep) behave like s.split().  That's not
> unheard of but it does go against our typical expectations.  It would
> have been a better library design if s.split() and s.split(sep) were
> different methods.
>   

It looks like they *were* different methods. The Oct 1996 edition of 
"Programming Python" (O'Reilly & Assoc.), based on Python 1.3, describes 
two separate functions in the "string" module in Chapter 16:

 string.split()
 string.splitfields(delim)

-John




More information about the Python-list mailing list