@@ -143,13 +143,13 @@ set_contains(PySetObject *so, PyObject *key)
143143 PyObject * tmp ;
144144 int result ;
145145
146- result = PySequence_Contains (so -> data , key );
146+ result = PyDict_Contains (so -> data , key );
147147 if (result == -1 && PyAnySet_Check (key )) {
148148 PyErr_Clear ();
149149 tmp = frozenset_dict_wrapper (((PySetObject * )(key ))-> data );
150150 if (tmp == NULL )
151151 return -1 ;
152- result = PySequence_Contains (so -> data , tmp );
152+ result = PyDict_Contains (so -> data , tmp );
153153 Py_DECREF (tmp );
154154 }
155155 return result ;
@@ -252,7 +252,7 @@ set_intersection(PySetObject *so, PyObject *other)
252252 }
253253
254254 while ((item = PyIter_Next (it )) != NULL ) {
255- if (PySequence_Contains (selfdata , item )) {
255+ if (PyDict_Contains (selfdata , item )) {
256256 if (PyDict_SetItem (tgtdata , item , Py_True ) == -1 ) {
257257 Py_DECREF (it );
258258 Py_DECREF (result );
@@ -292,7 +292,7 @@ set_intersection_update(PySetObject *so, PyObject *other)
292292
293293 selfdata = so -> data ;
294294 while ((item = PyIter_Next (it )) != NULL ) {
295- if (PySequence_Contains (selfdata , item )) {
295+ if (PyDict_Contains (selfdata , item )) {
296296 if (PyDict_SetItem (newdict , item , Py_True ) == -1 ) {
297297 Py_DECREF (newdict );
298298 Py_DECREF (it );
@@ -375,7 +375,7 @@ set_difference(PySetObject *so, PyObject *other)
375375 }
376376
377377 while ((item = PyIter_Next (it )) != NULL ) {
378- if (!PySequence_Contains (otherdata , item )) {
378+ if (!PyDict_Contains (otherdata , item )) {
379379 if (PyDict_SetItem (tgtdata , item , Py_True ) == -1 ) {
380380 Py_XDECREF (otherset );
381381 Py_DECREF (it );
@@ -481,7 +481,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
481481 return NULL ;
482482
483483 while ((item = PyIter_Next (it )) != NULL ) {
484- if (PySequence_Contains (selfdata , item )) {
484+ if (PyDict_Contains (selfdata , item )) {
485485 if (PyDict_DelItem (selfdata , item ) == -1 ) {
486486 Py_XDECREF (otherset );
487487 Py_DECREF (it );
@@ -541,7 +541,7 @@ set_symmetric_difference(PySetObject *so, PyObject *other)
541541 return NULL ;
542542 }
543543 while ((item = PyIter_Next (it )) != NULL ) {
544- if (!PySequence_Contains (selfdata , item )) {
544+ if (!PyDict_Contains (selfdata , item )) {
545545 if (PyDict_SetItem (tgtdata , item , Py_True ) == -1 ) {
546546 Py_DECREF (it );
547547 Py_DECREF (item );
@@ -562,7 +562,7 @@ set_symmetric_difference(PySetObject *so, PyObject *other)
562562 return NULL ;
563563 }
564564 while ((item = PyIter_Next (it )) != NULL ) {
565- if (!PySequence_Contains (otherdata , item )) {
565+ if (!PyDict_Contains (otherdata , item )) {
566566 if (PyDict_SetItem (tgtdata , item , Py_True ) == -1 ) {
567567 Py_DECREF (it );
568568 Py_DECREF (item );
@@ -634,7 +634,7 @@ set_issubset(PySetObject *so, PyObject *other)
634634
635635 otherdata = ((PySetObject * )other )-> data ;
636636 while ((item = PyIter_Next (it )) != NULL ) {
637- if (!PySequence_Contains (otherdata , item )) {
637+ if (!PyDict_Contains (otherdata , item )) {
638638 Py_DECREF (it );
639639 Py_DECREF (item );
640640 Py_RETURN_FALSE ;
0 commit comments