New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-40890: Add mapping
property to dict views
#20749
bpo-40890: Add mapping
property to dict views
#20749
Conversation
Would you write a What's new entry too? |
@@ -4122,6 +4122,23 @@ _PyDictView_New(PyObject *dict, PyTypeObject *type) | |||
return (PyObject *)dv; | |||
} | |||
|
|||
static PyObject * | |||
dictview_mapping(PyObject *view) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should have signature compatible with getter
:
static PyObject *
dictview_mapping(PyObject *view, void *Py_UNUSED(ignored))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #20876
} | ||
|
||
static PyGetSetDef dictview_getset[] = { | ||
{"mapping", (getter)dictview_mapping, (setter)NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit cast to getter
is not needed if fix the signature.
As of bpo-40890 / pythongh-20749.
https://bugs.python.org/issue40890