Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e138f36 commit b1c4698Copy full SHA for b1c4698
2 files changed
Include/listobject.h
@@ -27,6 +27,7 @@ typedef struct {
27
extern DL_IMPORT(PyTypeObject) PyList_Type;
28
29
#define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type)
30
+#define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type)
31
32
extern DL_IMPORT(PyObject *) PyList_New(int size);
33
extern DL_IMPORT(int) PyList_Size(PyObject *);
Python/ceval.c
@@ -989,7 +989,7 @@ eval_frame(PyFrameObject *f)
989
case BINARY_SUBSCR:
990
w = POP();
991
v = POP();
992
- if (v->ob_type == &PyList_Type && PyInt_CheckExact(w)) {
+ if (PyList_CheckExact(v) && PyInt_CheckExact(w)) {
993
/* INLINE: list[int] */
994
long i = PyInt_AsLong(w);
995
if (i < 0)
0 commit comments