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-35992: Use PySequence_GetItem only if sq_item is not NULL #11857

Merged
merged 4 commits into from
Feb 17, 2019

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Feb 14, 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 assymetry. No tests failed, so I assume it was not intentional.

https://bugs.python.org/issue35992

Copy link
Contributor

@eamanu eamanu left a comment

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.

Co-Authored-By: ilevkivskyi <[email protected]>
@ilevkivskyi ilevkivskyi merged commit ac28147 into python:master Feb 17, 2019
@miss-islington
Copy link
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 <[email protected]>
@bedevere-bot
Copy link

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 <[email protected]>
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