| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…have been public right away. See python#108449
Sorry, something went wrong.
There was a problem hiding this comment.
The change lacks tests.
Sorry, something went wrong.
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. c:function:: PyObject* PyDict_Pop(PyObject *p, PyObject *key, PyObject *defaultobj) |
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.
Sorry, something went wrong.
There was a problem hiding this comment.
How would the caller know the popped value then?
Sorry, something went wrong.
| { | ||
| if (!PyDict_Check(dict)) { | ||
| PyErr_BadInternalCall(); | ||
| return -1; |
There was a problem hiding this comment.
Should certainly be return NULL?
Sorry, something went wrong.
|
I created PR #111939 based on this PR: I changed the API and added tests. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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/