[Python-Dev] "funny".split("")
Fredrik Lundh
fredrik@pythonware.com
Tue, 12 Mar 2002 20:25:07 +0100
david abrahams wrote:
> There's a reason to pursue the OP's expected result as opposed to just
> settling for list("funny"). If we pick a reasonable behavior for this
> case, it will save some number of people from having to write:
>
> if len(sep):
> divided = s.split(sep)
> else:
> divided = list(s)
(where the number is very close to zero, and where number times
the time needed to type in the above workaround is much less than
the amount of time you've all wasted by contributing to this thread)
btw, here's another data point:
>>> import re
>>> re.split("", "funny")
['funny']
</F>