[Python-checkins] r53667 - python/branches/release25-maint/Objects/setobject.c

raymond.hettinger python-checkins at python.org
Thu Feb 8 01:49:52 CET 2007


Author: raymond.hettinger
Date: Thu Feb  8 01:49:51 2007
New Revision: 53667

Modified:
   python/branches/release25-maint/Objects/setobject.c
Log:
Bypass set specific optimizations for set and frozenset subclasses.

Modified: python/branches/release25-maint/Objects/setobject.c
==============================================================================
--- python/branches/release25-maint/Objects/setobject.c	(original)
+++ python/branches/release25-maint/Objects/setobject.c	Thu Feb  8 01:49:51 2007
@@ -912,7 +912,7 @@
 {
 	PyObject *key, *it;
 
-	if (PyAnySet_Check(other))
+	if (PyAnySet_CheckExact(other))
 		return set_merge(so, other);
 
 	if (PyDict_CheckExact(other)) {
@@ -1190,7 +1190,7 @@
 	if (result == NULL)
 		return NULL;
 
-	if (PyAnySet_Check(other)) {		
+	if (PyAnySet_CheckExact(other)) {		
 		Py_ssize_t pos = 0;
 		setentry *entry;
 
@@ -1314,7 +1314,7 @@
 	if ((PyObject *)so == other)
 		return set_clear_internal(so);
 	
-	if (PyAnySet_Check(other)) {
+	if (PyAnySet_CheckExact(other)) {
 		setentry *entry;
 		Py_ssize_t pos = 0;
 
@@ -1363,7 +1363,7 @@
 	setentry *entry;
 	Py_ssize_t pos = 0;
 
-	if (!PyAnySet_Check(other)  && !PyDict_CheckExact(other)) {
+	if (!PyAnySet_CheckExact(other)  && !PyDict_CheckExact(other)) {
 		result = set_copy(so);
 		if (result == NULL)
 			return NULL;
@@ -1472,7 +1472,7 @@
 		Py_RETURN_NONE;
 	}
 
-	if (PyAnySet_Check(other)) {
+	if (PyAnySet_CheckExact(other)) {
 		Py_INCREF(other);
 		otherset = (PySetObject *)other;
 	} else {
@@ -1555,7 +1555,7 @@
 	setentry *entry;
 	Py_ssize_t pos = 0;
 
-	if (!PyAnySet_Check(other)) {
+	if (!PyAnySet_CheckExact(other)) {
 		PyObject *tmp, *result;
 		tmp = make_new_set(&PySet_Type, other);
 		if (tmp == NULL)
@@ -1584,7 +1584,7 @@
 {
 	PyObject *tmp, *result;
 
-	if (!PyAnySet_Check(other)) {
+	if (!PyAnySet_CheckExact(other)) {
 		tmp = make_new_set(&PySet_Type, other);
 		if (tmp == NULL)
 			return NULL;


More information about the Python-checkins mailing list