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.

Title: str.strip() documentation: wrong example
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: SebKL, docs@python, josh.r, python-dev, raulcd
Priority: normal Keywords: patch

Created on 2014-09-22 08:32 by SebKL, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
issue22459.patch raulcd, 2014-09-22 21:17 Patch review
Messages (5)
msg227257 - (view) Author: SebKL (SebKL) Date: 2014-09-22 08:32
The following example is wrong:

>>> '1,2,3'.split(',', maxsplit=1)
['1', '2 3']

Is actually returning (note the missing , ):
>>> '1,2,3'.split(',', maxsplit=1)
['1', '2,3']
msg227258 - (view) Author: Raúl Cumplido (raulcd) * Date: 2014-09-22 09:46
As it is a simple one I will try to submit a patch today or tomorrow. This will be my first contribution to Python.
msg227309 - (view) Author: Raúl Cumplido (raulcd) * Date: 2014-09-22 21:17
It was also incorrect on the example for bytes split:
>>> b'1,2,3'.split(b',', maxsplit=1)
      [b'1', b'2 3']

Patch submitted.
msg227322 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2014-09-23 02:31
LGTM. About a straightforward as it gets.
msg227323 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-23 02:44
New changeset 8eb4eec8626c by Benjamin Peterson in branch '3.4':
fix error in split() examples (closes #22459)

New changeset 6dcc96fa3970 by Benjamin Peterson in branch 'default':
merge 3.4 (#22459)
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66649
2014-09-23 02:44:44python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg227323

resolution: fixed
stage: resolved
2014-09-23 02:31:54josh.rsetnosy: + josh.r
messages: + msg227322
2014-09-22 21:17:14raulcdsetfiles: + issue22459.patch
keywords: + patch
messages: + msg227309
2014-09-22 09:46:35raulcdsetnosy: + raulcd
messages: + msg227258
2014-09-22 08:32:10SebKLcreate