A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/020995.html below:

[Python-Dev] "funny".split("")

[Python-Dev] "funny".split("") [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>




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4