mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`. Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
3e23fa71f4
commit
a840806d33
6 changed files with 68 additions and 1 deletions
|
@ -237,6 +237,13 @@ _PyType_GetDict(PyTypeObject *self)
|
|||
return lookup_tp_dict(self);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
PyType_GetDict(PyTypeObject *self)
|
||||
{
|
||||
PyObject *dict = lookup_tp_dict(self);
|
||||
return _Py_XNewRef(dict);
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_tp_dict(PyTypeObject *self, PyObject *dict)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue