GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-111262: Make PyDict_Pop() public by scoder · Pull Request #111263 · python/cpython Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The change lacks tests.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. c:function:: PyObject* PyDict_Pop(PyObject *p, PyObject *key, PyObject *defaultobj) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to return -1 on error, 0 if the key doesn't exist, 1 if the key exists.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
How would the caller know the popped value then?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| { | ||
| if (!PyDict_Check(dict)) { | ||
| PyErr_BadInternalCall(); | ||
| return -1; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should certainly be return NULL?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I created PR #111939 based on this PR: I changed the API and added tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.