Lines Matching +defs:other +defs:kwds
560 PySetObject *other;
569 other = (PySetObject*)otherset;
570 if (other == so || other->used == 0)
577 if ((so->fill + other->used)*5 >= so->mask*3) {
578 if (set_table_resize(so, (so->used + other->used)*2) != 0)
582 other_entry = other->table;
586 if (so->fill == 0 && so->mask == other->mask && other->fill == other->used) {
587 for (i = 0; i <= other->mask; i++, so_entry++, other_entry++) {
596 so->fill = other->fill;
597 so->used = other->used;
605 so->fill = other->used;
606 so->used = other->used;
607 for (i = other->mask + 1; i > 0 ; i--, other_entry++) {
618 for (i = 0; i <= other->mask; i++) {
619 other_entry = &other->table[i];
881 set_update_internal(PySetObject *so, PyObject *other)
885 if (PyAnySet_Check(other))
886 return set_merge(so, other);
888 if (PyDict_CheckExact(other)) {
892 Py_ssize_t dictsize = PyDict_GET_SIZE(other);
904 while (_PyDict_Next(other, &pos, &key, &value, &hash)) {
911 it = PyObject_GetIter(other);
935 PyObject *other = PyTuple_GET_ITEM(args, i);
936 if (set_update_internal(so, other))
1007 frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1013 !_PyArg_NoKeywords("frozenset", kwds)) {
1042 set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1124 PyObject *other;
1132 other = PyTuple_GET_ITEM(args, i);
1133 if ((PyObject *)so == other)
1135 if (set_update_internal(result, other)) {
1149 set_or(PySetObject *so, PyObject *other)
1153 if (!PyAnySet_Check(so) || !PyAnySet_Check(other))
1159 if ((PyObject *)so == other)
1161 if (set_update_internal(result, other)) {
1169 set_ior(PySetObject *so, PyObject *other)
1171 if (!PyAnySet_Check(other))
1174 if (set_update_internal(so, other))
1181 set_intersection(PySetObject *so, PyObject *other)
1188 if ((PyObject *)so == other)
1195 if (PyAnySet_Check(other)) {
1199 if (PySet_GET_SIZE(other) > PySet_GET_SIZE(so)) {
1201 so = (PySetObject *)other;
1202 other = tmp;
1205 while (set_next((PySetObject *)other, &pos, &entry)) {
1227 it = PyObject_GetIter(other);
1274 PyObject *other = PyTuple_GET_ITEM(args, i);
1275 PyObject *newresult = set_intersection((PySetObject *)result, other);
1292 set_intersection_update(PySetObject *so, PyObject *other)
1296 tmp = set_intersection(so, other);
1321 set_and(PySetObject *so, PyObject *other)
1323 if (!PyAnySet_Check(so) || !PyAnySet_Check(other))
1325 return set_intersection(so, other);
1329 set_iand(PySetObject *so, PyObject *other)
1333 if (!PyAnySet_Check(other))
1335 result = set_intersection_update(so, other);
1344 set_isdisjoint(PySetObject *so, PyObject *other)
1349 if ((PyObject *)so == other) {
1356 if (PyAnySet_CheckExact(other)) {
1360 if (PySet_GET_SIZE(other) > PySet_GET_SIZE(so)) {
1362 so = (PySetObject *)other;
1363 other = tmp;
1365 while (set_next((PySetObject *)other, &pos, &entry)) {
1380 it = PyObject_GetIter(other);
1406 set_difference_update_internal(PySetObject *so, PyObject *other)
1408 if ((PyObject *)so == other)
1411 if (PyAnySet_Check(other)) {
1415 /* Optimization: When the other set is more than 8 times
1416 larger than the base set, replace the other set with
1419 if ((PySet_GET_SIZE(other) >> 3) > PySet_GET_SIZE(so)) {
1420 other = set_intersection(so, other);
1421 if (other == NULL)
1424 Py_INCREF(other);
1427 while (set_next((PySetObject *)other, &pos, &entry)) {
1431 Py_DECREF(other);
1438 Py_DECREF(other);
1441 it = PyObject_GetIter(other);
1469 PyObject *other = PyTuple_GET_ITEM(args, i);
1470 if (set_difference_update_internal(so, other))
1480 set_copy_and_difference(PySetObject *so, PyObject *other)
1487 if (set_difference_update_internal((PySetObject *) result, other) == 0)
1494 set_difference(PySetObject *so, PyObject *other)
1503 if (PyAnySet_Check(other)) {
1504 other_size = PySet_GET_SIZE(other);
1506 else if (PyDict_CheckExact(other)) {
1507 other_size = PyDict_GET_SIZE(other);
1510 return set_copy_and_difference(so, other);
1513 /* If len(so) much more than len(other), it's more efficient to simply copy
1514 * so and then iterate other looking for common elements. */
1516 return set_copy_and_difference(so, other);
1523 if (PyDict_CheckExact(other)) {
1528 rv = _PyDict_Contains_KnownHash(other, key, hash);
1546 /* Iterate over so, checking for common elements in other. */
1551 rv = set_contains_entry((PySetObject *)other, key, hash);
1573 PyObject *result, *other;
1578 other = PyTuple_GET_ITEM(args, 0);
1579 result = set_difference(so, other);
1584 other = PyTuple_GET_ITEM(args, i);
1585 if (set_difference_update_internal((PySetObject *)result, other)) {
1598 set_sub(PySetObject *so, PyObject *other)
1600 if (!PyAnySet_Check(so) || !PyAnySet_Check(other))
1602 return set_difference(so, other);
1606 set_isub(PySetObject *so, PyObject *other)
1608 if (!PyAnySet_Check(other))
1610 if (set_difference_update_internal(so, other))
1617 set_symmetric_difference_update(PySetObject *so, PyObject *other)
1626 if ((PyObject *)so == other)
1629 if (PyDict_CheckExact(other)) {
1631 while (_PyDict_Next(other, &pos, &key, &value, &hash)) {
1649 if (PyAnySet_Check(other)) {
1650 Py_INCREF(other);
1651 otherset = (PySetObject *)other;
1653 otherset = (PySetObject *)make_new_set_basetype(Py_TYPE(so), other);
1685 set_symmetric_difference(PySetObject *so, PyObject *other)
1690 otherset = (PySetObject *)make_new_set_basetype(Py_TYPE(so), other);
1708 set_xor(PySetObject *so, PyObject *other)
1710 if (!PyAnySet_Check(so) || !PyAnySet_Check(other))
1712 return set_symmetric_difference(so, other);
1716 set_ixor(PySetObject *so, PyObject *other)
1720 if (!PyAnySet_Check(other))
1722 result = set_symmetric_difference_update(so, other);
1731 set_issubset(PySetObject *so, PyObject *other)
1737 if (!PyAnySet_Check(other)) {
1739 tmp = make_new_set(&PySet_Type, other);
1746 if (PySet_GET_SIZE(so) > PySet_GET_SIZE(other))
1752 rv = set_contains_entry((PySetObject *)other, key, entry->hash);
1767 set_issuperset(PySetObject *so, PyObject *other)
1769 if (PyAnySet_Check(other)) {
1770 return set_issubset((PySetObject *)other, (PyObject *)so);
1773 PyObject *key, *it = PyObject_GetIter(other);
1982 set_init(PySetObject *self, PyObject *args, PyObject *kwds)
1986 if (!_PyArg_NoKeywords("set", kwds))