Skip to content
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

Merged
merged 5 commits into from Jun 12, 2020

Conversation

sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Jun 9, 2020

@methane
Copy link
Member

methane commented Jun 12, 2020

Would you write a What's new entry too?

@rhettinger rhettinger merged commit 3ee0e48 into python:master Jun 12, 2020
@@ -4122,6 +4122,23 @@ _PyDictView_New(PyObject *dict, PyTypeObject *type)
return (PyObject *)dv;
}

static PyObject *
dictview_mapping(PyObject *view)
Copy link
Member

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))

Copy link
Member

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,
Copy link
Member

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.

arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
jab added a commit to jab/cpython that referenced this pull request Oct 11, 2021
@sweeneyde sweeneyde deleted the dictview_mapping_descriptor branch January 25, 2022 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants