Lines Matching +defs:other +defs:kwds
195 The other half of the strategy is to get the other bits of the hash code
2687 dict_update_common(PyObject *self, PyObject *args, PyObject *kwds,
2700 if (result == 0 && kwds != NULL) {
2701 if (PyArg_ValidateKeywordArguments(kwds))
2702 result = PyDict_Merge(self, kwds, 1);
2713 dict_update(PyObject *self, PyObject *args, PyObject *kwds)
2715 if (dict_update_common(self, args, kwds, "update") != -1)
2818 PyDictObject *mp, *other;
2833 other = (PyDictObject*)b;
2834 if (other == mp || other->ma_used == 0)
2843 PyDictKeysObject *okeys = other->ma_keys;
2845 // If other is clean, combined, and just allocated, just clone it.
2846 if (other->ma_values == NULL &&
2847 other->ma_used == okeys->dk_nentries &&
2849 USABLE_FRACTION(DK_SIZE(okeys)/2) < other->ma_used)) {
2850 PyDictKeysObject *keys = clone_combined_dict_keys(other);
2862 mp->ma_used = other->ma_used;
2866 if (_PyObject_GC_IS_TRACKED(other) && !_PyObject_GC_IS_TRACKED(mp)) {
2878 if (USABLE_FRACTION(DK_SIZE(mp->ma_keys)) < other->ma_used) {
2879 int unicode = DK_IS_UNICODE(other->ma_keys);
2880 if (dictresize(mp, estimate_log2_keysize(mp->ma_used + other->ma_used), unicode)) {
2885 Py_ssize_t orig_size = other->ma_keys->dk_nentries;
2890 while (_PyDict_Next((PyObject*)other, &pos, &key, &value, &hash)) {
2921 if (orig_size != other->ma_keys->dk_nentries) {
2939 * do the same for any other error.
3606 dict_or(PyObject *self, PyObject *other)
3608 if (!PyDict_Check(self) || !PyDict_Check(other)) {
3615 if (dict_update_arg(new, other)) {
3623 dict_ior(PyObject *self, PyObject *other)
3625 if (dict_update_arg(self, other)) {
3753 dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
3787 dict_init(PyObject *self, PyObject *args, PyObject *kwds)
3789 return dict_update_common(self, args, kwds, "dict");
4620 /* Return 1 if self is a subset of other, iterating over self;
4623 all_contained_in(PyObject *self, PyObject *other)
4637 ok = PySequence_Contains(other, next);
4647 dictview_richcompare(PyObject *self, PyObject *other, int op)
4655 assert(other != NULL);
4657 if (!PyAnySet_Check(other) && !PyDictViewSet_Check(other))
4663 len_other = PyObject_Size(other);
4673 ok = all_contained_in(self, other);
4680 ok = all_contained_in(self, other);
4685 ok = all_contained_in(self, other);
4690 ok = all_contained_in(other, self);
4695 ok = all_contained_in(other, self);
4777 dictviews_sub(PyObject *self, PyObject *other)
4785 result, &_Py_ID(difference_update), other);
4799 _PyDictView_Intersect(PyObject* self, PyObject *other)
4811 PyObject *tmp = other;
4812 other = self;
4818 /* if other is a set and self is smaller than other,
4820 if (PySet_CheckExact(other) && len_self <= PyObject_Size(other)) {
4822 other, &_Py_ID(intersection), self, NULL);
4825 /* if other is another dict view, and it is bigger than self,
4827 if (PyDictViewSet_Check(other)) {
4828 Py_ssize_t len_other = dictview_len((_PyDictViewObject *)other);
4830 PyObject *tmp = other;
4831 other = self;
4838 2. if other is a dictview then it is smaller than self */
4843 it = PyObject_GetIter(other);
4884 dictviews_or(PyObject* self, PyObject *other)
4891 if (_PySet_Update(result, other) < 0) {
4899 dictitems_xor(PyObject *self, PyObject *other)
4902 assert(PyDictItems_Check(other));
4904 PyObject *d2 = (PyObject *)((_PyDictViewObject *)other)->dv_dict;
4985 dictviews_xor(PyObject* self, PyObject *other)
4987 if (PyDictItems_Check(self) && PyDictItems_Check(other)) {
4988 return dictitems_xor(self, other);
4996 result, &_Py_ID(symmetric_difference_update), other);
5026 dictviews_isdisjoint(PyObject *self, PyObject *other)
5031 if (self == other) {
5038 /* Iterate over the shorter object (only if other is a set,
5040 if (PyAnySet_Check(other) || PyDictViewSet_Check(other)) {
5042 Py_ssize_t len_other = PyObject_Size(other);
5047 PyObject *tmp = other;
5048 other = self;
5053 it = PyObject_GetIter(other);