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/2004-March/042934.html below:

[Python-Dev] Bug 911080, string split oddness

[Python-Dev] Bug 911080, string split oddness [Python-Dev] Bug 911080, string split oddnessPete Shinners pete at shinners.org
Sat Mar 6 15:52:13 EST 2004
I just filed Bug #911080. Sorry if this has been discussed before, at 
minimum I believe there should be a documentation fix.

http://sourceforge.net/tracker/index.php?func=detail&aid=911080&group_id=5470&atid=105470


Basically this documents the difference between
     "a b  c".split()
     "a b  c".split(" ")

This is a quirky little change in behavior that I've seen confuse newbies. 
Unfortunately there are needs for both styles of splitting.

In a world where backward breaking changes aren't a big deal, I would think 
split() would always work like the first version, and splitfields() would 
change to work like the second version. But that would break just about 
everything, so I suppose split either needs another optional argument or a 
different split method. (splitgroup? splitseq?)

The only workaround is to use regular expression splitting. But that's not a 
direction I like to point newbies towards too quickly.


More information about the Python-Dev mailing list

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