Frozensets do not benefit from autoconversion.

This commit is contained in:
Raymond Hettinger 2008-05-08 04:35:20 +00:00
parent 2e6407d813
commit c5a1cc5c37
1 changed files with 3 additions and 3 deletions

View File

@ -1755,7 +1755,7 @@ set_contains(PySetObject *so, PyObject *key)
rv = set_contains_key(so, key); rv = set_contains_key(so, key);
if (rv == -1) { if (rv == -1) {
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)) if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
return -1; return -1;
PyErr_Clear(); PyErr_Clear();
tmpkey = make_new_set(&PyFrozenSet_Type, NULL); tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
@ -1790,7 +1790,7 @@ set_remove(PySetObject *so, PyObject *key)
rv = set_discard_key(so, key); rv = set_discard_key(so, key);
if (rv == -1) { if (rv == -1) {
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)) if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
return NULL; return NULL;
PyErr_Clear(); PyErr_Clear();
tmpkey = make_new_set(&PyFrozenSet_Type, NULL); tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
@ -1821,7 +1821,7 @@ set_discard(PySetObject *so, PyObject *key)
rv = set_discard_key(so, key); rv = set_discard_key(so, key);
if (rv == -1) { if (rv == -1) {
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)) if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
return NULL; return NULL;
PyErr_Clear(); PyErr_Clear();
tmpkey = make_new_set(&PyFrozenSet_Type, NULL); tmpkey = make_new_set(&PyFrozenSet_Type, NULL);