Skip to content

bpo-40890: Add mapping property to dict views#20749

Merged
rhettinger merged 5 commits into
python:masterfrom
sweeneyde:dictview_mapping_descriptor
Jun 12, 2020
Merged

bpo-40890: Add mapping property to dict views#20749
rhettinger merged 5 commits into
python:masterfrom
sweeneyde:dictview_mapping_descriptor

Conversation

@sweeneyde

@sweeneyde sweeneyde commented Jun 9, 2020

Copy link
Copy Markdown
Member

@methane

methane commented Jun 12, 2020

Copy link
Copy Markdown
Member

Would you write a What's new entry too?

@rhettinger
rhettinger merged commit 3ee0e48 into python:master Jun 12, 2020
Comment thread Objects/dictobject.c
}

static PyObject *
dictview_mapping(PyObject *view)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #20876

Comment thread Objects/dictobject.c
}

static PyGetSetDef dictview_getset[] = {
{"mapping", (getter)dictview_mapping, (setter)NULL,

Copy link
Copy Markdown
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.

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.

7 participants