Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-106487: Allow the 'count' argument ofstr.replace to be a keyword#106488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 4 commits intopython:mainfromhugovk:str-replace-keyword-count
Jul 10, 2023

Conversation

hugovk
Copy link
Member

@hugovkhugovk commentedJul 6, 2023
edited by github-actionsbot
Loading

Before

>>>"aa".replace("a","b")'bb'>>>"aa".replace("a","b",1)'aa'>>>"aa".replace("a","b",count=1)TypeError: str.replace() takes no keyword arguments

After

>>>"aa".replace("a","b")'bb'>>>"aa".replace("a","b",0)'aa'>>>"aa".replace("a","b",count=0)'aa'>>>"aa".replace("a","b",1)'ba'>>>"aa".replace("a","b",count=1)'ba'>>>"aa".replace("a","b",2)'bb'>>>"aa".replace("a","b",count=2)'bb'>>>"aa".replace("a","b",3)'bb'>>>"aa".replace("a","b",count=3)'bb'

📚 Documentation preview 📚:https://cpython-previews--106488.org.readthedocs.build/

adamchainz reacted with thumbs up emoji
@hugovkhugovk changed the titlegh-106487: Allow the *count* argument ofstr.replace to be a keywordgh-106487: Allow the 'count' argument ofstr.replace to be a keywordJul 6, 2023
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@hugovkhugovk merged commit34c1414 intopython:mainJul 10, 2023
@hugovkhugovk deleted the str-replace-keyword-count branchJuly 10, 2023 09:52
@vstinner
Copy link
Member

vstinner commentedJul 10, 2023
edited
Loading

Nice enhancement. It's funny to have Mastodon driven development 😁

hugovk, tusharsadhwani, MartinCura, and acciochris reacted with laugh emoji

@hugovk
Copy link
MemberAuthor

T[witter]DD is so last year.

MartinCura reacted with laugh emoji

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

@vstinnervstinnervstinner approved these changes

Assignees
No one assigned
Labels
3.13bugs and security fixes
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@hugovk@vstinner@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp