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!
This commit is contained in:
Guido van Rossum 1991-07-01 18:44:20 +00:00
parent 89d55cad95
commit efc0bd02e5
1 changed files with 1 additions and 1 deletions

View File

@ -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)