8000 BUG: core: fix NPY_TITLE_KEY macro on pypy by ahaldane · Pull Request #10962 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: core: fix NPY_TITLE_KEY macro on pypy #10962

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

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

ahaldane
Copy link
Member

Backport of #10860

On Pypy, dictionary keys do not necessarily preserve object identity.

This however was assumed by the NPY_TITLE_KEY macro, which relies on
descriptor.c:568 using the same 'title' object both as a dictionary key
as an entry in the tuple inserted.

Since the items in the field dict are unique, value identity is however
sufficient for the NPY_TITLE_KEY macro. On PyPy, fix the macro by
comparing values instead.

On Pypy, dictionary keys do not necessarily preserve object identity.

This however was assumed by the NPY_TITLE_KEY macro, which relies on
descriptor.c:568 using the same 'title' object both as a dictionary key
as an entry in the tuple inserted.

Since the items in the field dict are unique, value identity is however
sufficient for the NPY_TITLE_KEY macro. On PyPy, fix the macro by
comparing values instead.
@ahaldane ahaldane added this to the 1.14.3 release milestone Apr 23, 2018
@ahaldane ahaldane merged commit cfa022f into numpy:maintenance/1.14.x Apr 23, 2018
@charris charris changed the title (Backport 1.14.3) BUG: core: fix NPY_TITLE_KEY macro on pypy BUG: core: fix NPY_TITLE_KEY macro on pypy Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0