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 2012年02月22日 01:54 by ncoghlan, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue14081.diff | ezio.melotti, 2012年02月22日 03:16 | Patch + tests | review | |
| issue14081-2.diff | ezio.melotti, 2012年02月24日 10:30 | |||
| Messages (7) | |||
|---|---|---|---|
| msg153920 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年02月22日 01:54 | |
Currently, setting maxsplit for the default "any whitespace" behaviour requires the following cryptic incantation: 'do re mi fa'.split(None, 1) That would be significantly more comprehensible as: 'do re mi fa'.split(maxsplit=1) (I noticed this when trying to figure out why http://hyperpolyglot.org/scripting#split-notes resorted to using the re module to achieve this) |
|||
| msg153924 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年02月22日 03:16 | |
+1 Patch attached. |
|||
| msg154130 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年02月24日 10:30 | |
New patch that changes .rsplit() too and updates docs and docstrings. |
|||
| msg154194 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年02月25日 07:16 | |
LGTM. (Nick: I think the author directly translated the regex function calls from other languages to using re in Python.) |
|||
| msg154222 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年02月25日 09:41 | |
Ezio: I spotted an extraneous '[' hanging around in the updated doc signature for split, but otherwise looked fine. Éric: you're probably right, but I was sending them a note to suggest a simpler alternative, only to discover that the obvious approach of "maxsplit=1" didn't actually work. |
|||
| msg154311 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年02月26日 07:40 | |
New changeset db968ac2b82c by Ezio Melotti in branch 'default': #14081: The sep and maxsplit parameter to str.split, bytes.split, and bytearray.split may now be passed as keyword arguments. http://hg.python.org/cpython/rev/db968ac2b82c |
|||
| msg154312 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年02月26日 07:44 | |
Fixed! Thanks for the reviews and for spotting the extra '['. (While suggesting the use of maxsplit, be aware that str.split uses -1 as default value, whereas re.split uses 0.) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58289 |
| 2012年02月26日 07:44:14 | ezio.melotti | set | status: open -> closed resolution: fixed messages: + msg154312 stage: commit review -> resolved |
| 2012年02月26日 07:40:08 | python-dev | set | nosy:
+ python-dev messages: + msg154311 |
| 2012年02月25日 09:41:45 | ncoghlan | set | messages: + msg154222 |
| 2012年02月25日 07:16:24 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg154194 |
| 2012年02月24日 16:05:25 | tshepang | set | nosy:
+ tshepang |
| 2012年02月24日 10:31:00 | ezio.melotti | set | files:
+ issue14081-2.diff messages: + msg154130 |
| 2012年02月22日 03:16:52 | ezio.melotti | set | files:
+ issue14081.diff assignee: ezio.melotti keywords: + patch nosy: + ezio.melotti messages: + msg153924 stage: needs patch -> commit review |
| 2012年02月22日 01:54:09 | ncoghlan | create | |