Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 303:149dd121d0a6 legacy-trunk
Check for identical types before comparing objects to see if they
are the same -- 0 and 0.0 compare equal but should be considered different
here!
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 01 Jul 1991 18:44:20 +0000 |
| parents | b5826bf29677 |
| children | 325b40d77235 |
line wrap: on
line diff
--- a/Python/compile.c Mon Jul 01 18:43:13 1991 +0000 +++ b/Python/compile.c Mon Jul 01 18:44:20 1991 +0000 @@ -292,7 +292,7 @@ int i; for (i = n; --i >= 0; ) { object *w = getlistitem(list, i); - if (cmpobject(v, w) == 0) + if (v->ob_type == w->ob_type && cmpobject(v, w) == 0) return i; } if (addlistitem(list, v) != 0)
