[Python-Dev] Re: Bug 911080, string split oddness
pete at shinners.org
Sun Mar 7 01:12:12 EST 2004
Jeff Epler wrote:
> I think the current version documentation intends to explain the
> no-argument form with this sentence:
> If sep is not specified or None, any whitespace string is a separator.
I'm having a hard time making this clear. By reading the documentation I
would guess that "split()" would be equivalent to
"split(string.whitespace)". In fact they work very differently.
With no separator argument, the separators are grouped. The problem comes
when your splitted string has multiple separators next to each other. To
make them work the same is more like this
More information about the Python-Dev