This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2007年10月05日 13:20 by QuantumTim, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg56237 - (view) | Author: Tim Gordon (QuantumTim) | Date: 2007年10月05日 13:20 | |
From the docs for str.split: "If sep is not specified or is None... First, whitespace characters are stripped from both ends. Then, words are separated by arbitrary length strings of whitespace characters." However, ' a b c '.split(None, 1) returns ['a', 'b c '] indicating that the "stripped from both ends" isn't taking place, but that it's removing whitespace as it goes and never gets to the end as it stops parsing when it hits the first split. Note this is easily worked around by calling str.strip().split(None, 1), but it would be good not to have to. I've tested this on windows version 2.5, and 2.4.4 for Debian |
|||
| msg56242 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2007年10月05日 17:21 | |
I know there is another filed bug on this topic, I just need to find it. |
|||
| msg56254 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2007年10月06日 22:35 | |
It was deemed a documentation bug. |
|||
| msg56258 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2007年10月07日 20:05 | |
issue1123 was the issue I was thinking of. Setting that as a superceder as 1123 was closed prematurely. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:27 | admin | set | github: 45581 |
| 2007年10月07日 20:06:03 | brett.cannon | set | status: open -> closed resolution: duplicate |
| 2007年10月07日 20:05:53 | brett.cannon | set | superseder: split(None, maxsplit) does not strip whitespace correctly messages: + msg56258 |
| 2007年10月06日 22:35:24 | gvanrossum | set | nosy:
+ gvanrossum messages: + msg56254 |
| 2007年10月05日 17:21:58 | brett.cannon | set | nosy:
+ brett.cannon messages: + msg56242 |
| 2007年10月05日 13:22:01 | QuantumTim | set | title: str.split bug -> str.split bug when using sep = None and maxsplit |
| 2007年10月05日 13:21:11 | QuantumTim | set | title: str.split possible bug -> str.split bug |
| 2007年10月05日 13:20:23 | QuantumTim | create | |