Skip to content

Conversation

@Unique-Usman
Copy link
Contributor

@Unique-UsmanUnique-Usman commented Oct 24, 2023

Changed the doc for str.rsplit to be from 'starting from the left' to 'starting from the right' as str.rsplit start from the right

… 'starting from the right' as str.rsplit start from the right
@Unique-UsmanUnique-Usman changed the title Changed the doc for str.rsplit to be from 'starting from the left' to…gh-110383: Changed the doc for str.rsplit from 'starting from the left' to 'starting from the right' Oct 24, 2023
@bedevere-appbedevere-appbot mentioned this pull request Oct 24, 2023
@erlend-aasland
Copy link
Contributor

You need to change the clinic input code in Objects/unicodeobject.c. Directly manipulating the clinic output (anything that lives inside a clinic/ directory) will never work; future updates to the clinic input would overwrite such a change, but you'd never be able to check in such a change because we've got CI checks to prevent changes to generated code (see the "Check if generated files are up to date" CI check).

There's an Argument Clinic How-to in the devguide. I suggest you start with that, and then retarget this PR to change Objects/unicodeobject.c instead.

@Unique-Usman
Copy link
ContributorAuthor

Unique-Usman commented Nov 10, 2023

Yeah @erlend-aasland thanks for the suggestion, I will look into it.

@sparrowt
Copy link
Contributor

Looks like it's this line specifically the = str.split on the end that is "cloning" the per-parameter docstrings from split onto rsplit.

Given the docs say:

Sorry, there’s no syntax for partially cloning a function, or cloning a function then modifying it. Cloning is an all-or nothing proposition.

it seems like the only option is to stop cloning and then copy-paste the parameter docstrings from splithere into rsplithere.

@sparrowt
Copy link
Contributor

I've opened #113353 which hopefully does the right thing

@erlend-aasland
Copy link
Contributor

I propose a different approach in #113355.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Unique-Usman@erlend-aasland@sparrowt