Small inconsistency between string.split and "".split

Erik Heneryd erik at heneryd.com
Mon Sep 13 15:08:51 EDT 2004


Batista, Facundo wrote:
> [Erik Heneryd]
> 
> #- 2) You can get the same behavior from str.split() by using 
> #- None as the 
> #- separator (undocumented, I guess).
> 
> Worst: it's explicitly in other way:
> 
> 	split([sep [,maxsplit]])
> 
> There, taken from the docs, say that "It's optional to include sep, and if
> you include sep, you could also (optionally) include maxsplit".

How is that different from what I said? ("If you look at the string lib 
docs, the parameters are meant to be positional, not keywords")


Erik

ps. ...and yeah, if I really had looked (more closely), I would've seen 
that None as separator is documented after all... :) ds.



More information about the Python-list mailing list