bpo-35992: Use PySequence_GetItem only if sq_item is not NULL by ilevkivskyi · Pull Request #11857 · python/cpython

@ilevkivskyi

@ilevkivskyi

@blurb-it

serhiy-storchaka

serhiy-storchaka

@serhiy-storchaka @ilevkivskyi

Co-Authored-By: ilevkivskyi <levkivskyi@gmail.com>

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>

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>