Closed
Conversation
5674aa3 to
9c8539b
Compare
…have been public right away. See python#108449
9c8539b to
16a95d4
Compare
Contributor
Author
vstinner
reviewed
Oct 24, 2023
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. c:function:: PyObject* PyDict_Pop(PyObject *p, PyObject *key, PyObject *defaultobj) |
Member
There was a problem hiding this comment.
I would prefer to return -1 on error, 0 if the key doesn't exist, 1 if the key exists.
Member
There was a problem hiding this comment.
How would the caller know the popped value then?
pitrou
reviewed
Nov 9, 2023
| { | ||
| if (!PyDict_Check(dict)) { | ||
| PyErr_BadInternalCall(); | ||
| return -1; |
Member
|
I created PR #111939 based on this PR: I changed the API and added tests. |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See #108449
I kept the internal function since it saves the type check on the fast path and can thus still be used internally.
📚 Documentation preview 📚: https://cpython-previews--111263.org.readthedocs.build/