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-131885: Document that dict.setdefault takes no keyword arguments#128208

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
picnixz merged 4 commits intopython:mainfromadamtheturtle:patch-2
Mar 30, 2025

Conversation

adamtheturtle
Copy link
Contributor

@adamtheturtleadamtheturtle commentedDec 23, 2024
edited by picnixz
Loading

Running

{}.setdefault("a",default=1)

gives:

TypeError: dict.setdefault() takes no keyword arguments

📚 Documentation preview 📚:https://cpython-previews--128208.org.readthedocs.build/en/128208/library/stdtypes.html#dict.setdefault

Running```python{}.setdefault("a", default=1)```gives:```TypeError: dict.setdefault() takes no keyword arguments```
@bedevere-appbedevere-appbot added docsDocumentation in the Doc dir skip news awaiting review labelsDec 23, 2024
@adamtheturtle
Copy link
ContributorAuthor

Related:#128207

@ZeroIntensityZeroIntensity added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsMar 25, 2025
Copy link
Member

@ZeroIntensityZeroIntensity left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on the review. Could you document this forget as well?

@adamtheturtle
Copy link
ContributorAuthor

Could you document this for get as well?

@ZeroIntensity I have now done that

Copy link
Member

@ZeroIntensityZeroIntensity left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@picnixzpicnixz changed the titleDocument that dict.setdefault takes no keyword argumentsgh-131885: Document that dict.setdefault takes no keyword argumentsMar 30, 2025
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

We could argue that this would violate the Mapping contract and that we have a "bug". Yes it violates the contract,however, the EB has decided that this should be the guidelines (see also#129669 (comment)), so this specific change should not be blocked.

@picnixzpicnixzenabled auto-merge (squash)March 30, 2025 09:18
@picnixzpicnixz merged commitedfbd8c intopython:mainMar 30, 2025
26 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsMar 30, 2025
@miss-islington-app
Copy link

Thanks@adamtheturtle for the PR, and@picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMar 30, 2025
…no keyword arguments (pythonGH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
@bedevere-app
Copy link

GH-131893 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMar 30, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMar 30, 2025
…no keyword arguments (pythonGH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
@bedevere-app
Copy link

GH-131894 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelMar 30, 2025
@picnixz
Copy link
Member

Thank you for the fix!

picnixz pushed a commit that referenced this pull requestMar 30, 2025
… no keyword arguments (GH-128208) (#131893)gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
picnixz pushed a commit that referenced this pull requestMar 30, 2025
… no keyword arguments (GH-128208) (#131894)gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
seehwan pushed a commit to seehwan/cpython that referenced this pull requestApr 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz approved these changes

@ZeroIntensityZeroIntensityZeroIntensity approved these changes

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
Status: Done
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@adamtheturtle@picnixz@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp