Skip to content

bpo-35992: Use PySequence_GetItem only if sq_item is not NULL#11857

Merged
ilevkivskyi merged 4 commits into
python:masterfrom
ilevkivskyi:fix-class-getitem
Feb 17, 2019
Merged

bpo-35992: Use PySequence_GetItem only if sq_item is not NULL#11857
ilevkivskyi merged 4 commits into
python:masterfrom
ilevkivskyi:fix-class-getitem

Conversation

@ilevkivskyi

@ilevkivskyi ilevkivskyi commented Feb 14, 2019

Copy link
Copy Markdown
Member

Not using __class_getitem__() fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how PySequenceMethods and PyMappingMethods are used in PyObject_GetItem. This PR removes this assymetry. No tests failed, so I assume it was not intentional.

https://bugs.python.org/issue35992

@eamanu eamanu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I test it and work ok for me.

Comment thread Misc/NEWS.d/next/Core and Builtins/2019-02-14-12-01-44.bpo-35992.nG9e2L.rst Outdated
Co-Authored-By: ilevkivskyi <levkivskyi@gmail.com>
@ilevkivskyi
ilevkivskyi merged commit ac28147 into python:master Feb 17, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @ilevkivskyi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@ilevkivskyi
ilevkivskyi deleted the fix-class-getitem branch February 17, 2019 23:14
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 17, 2019
…GH-11857)

Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
(cherry picked from commit ac28147)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-11910 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Feb 17, 2019
Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
(cherry picked from commit ac28147)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
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.

6 participants