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
Documentation for PyType_GetDict() Misleading #110891
The documentation for PyType_GetDict() is misleading as it says it is a replacement to accessing tp_dict directly. To me this implies it is a drop-in replacement. However the function returns a new reference to the dict and so needs a call to Py_DECREF at some point to avoid a memory leak.
Activity
ericvsmith commentedon Oct 16, 2023
I don't think the documentation is misleading: https://docs.python.org/3/c-api/type.html#c.PyType_GetDict doesn't say it's a drop-in replacement.
What changes would you propose making?
philthompson10 commentedon Oct 17, 2023
gh-110891: Document `PyType_GetDict` as returning a new reference (GH…
[3.14] gh-110891: Document `PyType_GetDict` as returning a new refere…
[3.15] gh-110891: Document `PyType_GetDict` as returning a new refere…