String split

Michele Petrazzo michele.petrazzo at TOGLIunipex.it
Tue Mar 28 16:19:11 CEST 2006


Hello ng,
I don't understand why split (string split) doesn't work with the same
method if I can't pass values or if I pass a whitespace value:

>>> "".split()
[]
>>> "".split(" ")
['']

But into the doc I see:
""" If sep is not specified or is None, any whitespace string is a
separator.
"""

In this two cases, split would to return the _same_ result?

Thanks,
Michele



More information about the Python-list mailing list