From: Guido van Rossum Date: Mon, 1 Jul 1991 18:44:20 +0000 (+0000) Subject: Check for identical types before comparing objects to see if they X-Git-Tag: v0.9.8~880 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efc0bd02e5a661ede3737ff1d051973166425514;p=thirdparty%2FPython%2Fcpython.git 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! --- diff --git a/Python/compile.c b/Python/compile.c index 76050031552d..71d13bc2f162 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -292,7 +292,7 @@ com_add(c, list, v) 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)