You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PyDict_GetItem and PyObject_HasAttr should not be used #106033
These functions are broken by design, because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. There were several rounds of getting rid of them in past (for example 567eba1, #11112, #75753), but they occur in new code.
Activity
pythongh-106033: Get rid of new occurrences of PyDict_GetItem and PyO…
gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_…
[3.11] pythongh-106033: Get rid of new occurrences of PyDict_GetItem …
[3.12] pythongh-106033: Get rid of new occurrences of PyDict_GetItem …
pythongh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstru…
gh-106033: [docs] Improve C API GetItem & HasAttr notes. (#106047)
pythongh-106033: [docs] Improve C API GetItem & HasAttr notes. (pytho…
pythongh-106033: [docs] Improve C API GetItem & HasAttr notes. (pytho…
[3.11] gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-1…
[3.12] gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-1…
[3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… (
[3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and Py… (
gh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstructor (G…
pythongh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstru…
[3.12] gh-106033: Get rid of PyDict_GetItem in _PyFunction_FromConstr…
iritkatriel commentedon Jun 30, 2023
See also #86172.
vstinner commentedon Jun 30, 2023
See also the issue #106004: I propose adding PyDict_GetItemRef() function which doesn't have these flaws.
erlend-aasland commentedon Jul 20, 2023
Can this be closed, or do you expect more work here, @serhiy-storchaka?