Skip to content

str.strip() documentation: wrong example #66649

Closed

Description

@SebKL
mannequin
BPO 22459
Nosy @MojoVampire, @raulcd
Files
  • issue22459.patch: Patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-09-23.02:44:44.730>
    created_at = <Date 2014-09-22.08:32:10.017>
    labels = ['type-feature', 'docs']
    title = 'str.strip() documentation: wrong example'
    updated_at = <Date 2014-09-23.02:44:44.727>
    user = 'https://bugs.python.org/SebKL'

    bugs.python.org fields:

    activity = <Date 2014-09-23.02:44:44.727>
    actor = 'python-dev'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2014-09-23.02:44:44.730>
    closer = 'python-dev'
    components = ['Documentation']
    creation = <Date 2014-09-22.08:32:10.017>
    creator = 'SebKL'
    dependencies = []
    files = ['36692']
    hgrepos = []
    issue_num = 22459
    keywords = ['patch']
    message_count = 5.0
    messages = ['227257', '227258', '227309', '227322', '227323']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'python-dev', 'josh.r', 'SebKL', 'raulcd']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22459'
    versions = ['Python 3.4', 'Python 3.5']

    Activity

    1. SebKL commented on Sep 22, 2014

      SebKLmannequin
      MannequinAuthor

      The following example is wrong:
      https://docs.python.org/3.4/library/stdtypes.html?highlight=split#str.split

      >>> '1,2,3'.split(',', maxsplit=1)
      ['1', '2 3']
      
      Is actually returning (note the missing , ):
      >>> '1,2,3'.split(',', maxsplit=1)
      ['1', '2,3']
    2. added
      docs
      type-feature
      on Sep 22, 2014
    3. raulcd commented on Sep 22, 2014

      raulcdmannequin
      Mannequin

      As it is a simple one I will try to submit a patch today or tomorrow. This will be my first contribution to Python.

    4. raulcd commented on Sep 22, 2014

      raulcdmannequin
      Mannequin
      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.

    5. MojoVampire commented on Sep 23, 2014

      MojoVampiremannequin
      Mannequin

      LGTM. About a straightforward as it gets.

    6. python-dev commented on Sep 23, 2014

      python-devmannequin
      Mannequin

      New changeset 8eb4eec8626c by Benjamin Peterson in branch '3.4':
      fix error in split() examples (closes bpo-22459)
      https://hg.python.org/cpython/rev/8eb4eec8626c

      New changeset 6dcc96fa3970 by Benjamin Peterson in branch 'default':
      merge 3.4 (bpo-22459)
      https://hg.python.org/cpython/rev/6dcc96fa3970

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docstype-feature

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions