GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-110383: Improve accuracy of str.split() and str.rsplit() docstrings by erlend-aasland · Pull Request #113355 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Dec 21, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Mention split direction in the docstring body,
instead of in the 'maxsplit' param docstring.

  • Issue: Issues from [email protected] #110383

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
pythongh-110383: Improve accuracy of str.split() and str.rsplit() doc…
c50dd46
…strings

Mention split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
@erlend-aasland erlend-aasland added skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Dec 21, 2023
@bedevere-app bedevere-app Bot added the awaiting core review label Dec 21, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 21, 2023
Issues from [email protected] #110383
Closed
@erlend-aasland
erlend-aasland requested a review from hugovk December 21, 2023 11:00
@erlend-aasland

erlend-aasland commented Dec 21, 2023

Copy link
Copy Markdown
Contributor Author

Alternative to #111247 and #113353.

sparrowt and Unique-Usman reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 21, 2023
gh-110383: Changed the doc for str.rsplit from 'starting from the left' to 'starting from the right' #111247
Closed
gh-110383: Fix docstring for str.rsplit maxsplit param to 'starting from the right' #113353
Closed
hugovk
hugovk approved these changes Dec 21, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good:

❯ ./python.exe
Python 3.13.0a2+ (heads/splitter!-dirty:c50dd463dd, Dec 21 2023, 14:51:45) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help(str().split)
Help on built-in function split:

split(sep=None, maxsplit=-1) method of builtins.str instance
    Return a list of the substrings in the string, using sep as the separator string.

      sep
        The separator used to split the string.

        When set to None (the default value), will split on any whitespace
        character (including \n \r \t \f and spaces) and will discard
        empty strings from the result.
      maxsplit
        Maximum number of splits.
        -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally
    delimited.  With natural text that includes punctuation, consider using
    the regular expression module.

>>> help(str().rsplit)
Help on built-in function rsplit:

rsplit(sep=None, maxsplit=-1) method of builtins.str instance
    Return a list of the substrings in the string, using sep as the separator string.

      sep
        The separator used to split the string.

        When set to None (the default value), will split on any whitespace
        character (including \n \r \t \f and spaces) and will discard
        empty strings from the result.
      maxsplit
        Maximum number of splits.
        -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

>>>

Thanks everyone!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Dec 21, 2023
@erlend-aasland
erlend-aasland merged commit 526d0a9 into python:main Dec 21, 2023
@erlend-aasland
erlend-aasland deleted the splitter! branch December 21, 2023 14:22
@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 21, 2023
@miss-islington-app

This comment was marked as outdated.

Sign in to view
@miss-islington-app

This comment was marked as outdated.

Sign in to view
@miss-islington-app miss-islington-app Bot assigned erlend-aasland Dec 21, 2023
@miss-islington-app

This comment was marked as outdated.

Sign in to view
@bedevere-bot

This comment was marked as off-topic.

Sign in to view
@bedevere-app

bedevere-app Bot commented Dec 21, 2023

Copy link
Copy Markdown

GH-113379 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Dec 21, 2023
hugovk pushed a commit to hugovk/cpython that referenced this pull request Dec 21, 2023
@erlend-aasland @hugovk
[3.12] pythongh-110383: Improve accuracy of str.split() and str.rspli…
e79e03d
…t() docstrings (pythonGH-113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
(cherry picked from commit 526d0a9)

Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-app

bedevere-app Bot commented Dec 21, 2023

Copy link
Copy Markdown

GH-113380 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Dec 21, 2023
hugovk pushed a commit to hugovk/cpython that referenced this pull request Dec 21, 2023
@erlend-aasland @hugovk
[3.11] pythongh-110383: Improve accuracy of str.split() and str.rspli…
325b641
…t() docstrings (pythonGH-113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
(cherry picked from commit 526d0a9)

Co-authored-by: Erlend E. Aasland <[email protected]>
hugovk added a commit that referenced this pull request Dec 22, 2023
@hugovk @erlend-aasland
[3.12] gh-110383: Improve accuracy of str.split() and str.rsplit() do…
2ddee2e
…cstrings (GH-113355) (#113379)

Co-authored-by: Erlend E. Aasland <[email protected]>
hugovk added a commit that referenced this pull request Dec 22, 2023
@hugovk @erlend-aasland
[3.11] gh-110383: Improve accuracy of str.split() and str.rsplit() do…
a39131e
…cstrings (GH-113355) (#113380)

Co-authored-by: Erlend E. Aasland <[email protected]>
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull request Dec 26, 2023
@erlend-aasland @ryan-duve
pythongh-110383: Improve accuracy of str.split() and str.rsplit() doc…
e61da02
…strings (python#113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
@erlend-aasland @kulikjak
pythongh-110383: Improve accuracy of str.split() and str.rsplit() doc…
62edc1e
…strings (python#113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@erlend-aasland @aisk
pythongh-110383: Improve accuracy of str.split() and str.rsplit() doc…
7f3f86e
…strings (python#113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@erlend-aasland @Glyphack
pythongh-110383: Improve accuracy of str.split() and str.rsplit() doc…
c713252
…strings (python#113355)

Clarify split direction in the docstring body,
instead of in the 'maxsplit' param docstring.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@erlend-aasland erlend-aasland

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@erlend-aasland @bedevere-bot @hugovk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.