Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Running```python{}.setdefault("a", default=1)```gives:```TypeError: dict.setdefault() takes no keyword arguments```
Related:#128207 |
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.
Sorry for the delay on the review. Could you document this forget
as well?
@ZeroIntensity I have now done that |
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.
Thanks, LGTM.
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.
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.
edfbd8c
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@adamtheturtle for the PR, and@picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…no keyword arguments (pythonGH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
GH-131893 is a backport of this pull request to the3.13 branch. |
…no keyword arguments (pythonGH-128208)(cherry picked from commitedfbd8c)Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
GH-131894 is a backport of this pull request to the3.12 branch. |
Thank you for the fix! |
…no keyword arguments (python#128208)
Uh oh!
There was an error while loading.Please reload this page.
Running
gives:
*
and/
as needed #131885📚 Documentation preview 📚:https://cpython-previews--128208.org.readthedocs.build/en/128208/library/stdtypes.html#dict.setdefault