Lines Matching defs:self

2670 dict_update_arg(PyObject *self, PyObject *arg)
2673 return PyDict_Merge(self, arg, 1);
2681 return PyDict_Merge(self, arg, 1);
2683 return PyDict_MergeFromSeq2(self, arg, 1);
2687 dict_update_common(PyObject *self, PyObject *args, PyObject *kwds,
2697 result = dict_update_arg(self, arg);
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)
3243 dict___contains__(PyDictObject *self, PyObject *key)
3246 register PyDictObject *mp = self;
3275 dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value)
3287 ix = _Py_dict_lookup(self, key, hash, &val);
3403 dict_setdefault_impl(PyDictObject *self, PyObject *key,
3409 val = PyDict_SetDefault((PyObject *)self, key, default_value);
3435 dict_pop_impl(PyDictObject *self, PyObject *key, PyObject *default_value)
3438 return _PyDict_Pop((PyObject*)self, key, default_value);
3451 dict_popitem_impl(PyDictObject *self)
3469 if (self->ma_used == 0) {
3475 if (self->ma_keys->dk_kind == DICT_KEYS_SPLIT) {
3476 if (dictresize(self, DK_LOG_SIZE(self->ma_keys), 1)) {
3481 self->ma_keys->dk_version = 0;
3486 if (DK_IS_UNICODE(self->ma_keys)) {
3487 PyDictUnicodeEntry *ep0 = DK_UNICODE_ENTRIES(self->ma_keys);
3488 i = self->ma_keys->dk_nentries - 1;
3501 PyDictKeyEntry *ep0 = DK_ENTRIES(self->ma_keys);
3502 i = self->ma_keys->dk_nentries - 1;
3516 j = lookdict_index(self->ma_keys, hash, i);
3518 assert(dictkeys_get_index(self->ma_keys, j) == i);
3519 dictkeys_set_index(self->ma_keys, j, DKIX_DUMMY);
3524 self->ma_keys->dk_nentries = i;
3525 self->ma_used--;
3526 self->ma_version_tag = DICT_NEXT_VERSION();
3527 ASSERT_CONSISTENT(self);
3606 dict_or(PyObject *self, PyObject *other)
3608 if (!PyDict_Check(self) || !PyDict_Check(other)) {
3611 PyObject *new = PyDict_Copy(self);
3623 dict_ior(PyObject *self, PyObject *other)
3625 if (dict_update_arg(self, other)) {
3628 Py_INCREF(self);
3629 return self;
3760 PyObject *self = type->tp_alloc(type, 0);
3761 if (self == NULL) {
3764 PyDictObject *d = (PyDictObject *)self;
3783 return self;
3787 dict_init(PyObject *self, PyObject *args, PyObject *kwds)
3789 return dict_update_common(self, args, kwds, "dict");
3801 PyObject *self = dict_new(_PyType_CAST(type), NULL, NULL);
3802 if (self == NULL) {
3806 if (dict_update_arg(self, args[0]) < 0) {
3807 Py_DECREF(self);
3814 if (PyDict_SetItem(self, PyTuple_GET_ITEM(kwnames, i), args[i]) < 0) {
3815 Py_DECREF(self);
3820 return self;
4495 dict___reversed___impl(PyDictObject *self)
4498 assert (PyDict_Check(self));
4499 return dictiter_new(self, &PyDictRevIterKey_Type);
4620 /* Return 1 if self is a subset of other, iterating over self;
4623 all_contained_in(PyObject *self, PyObject *other)
4625 PyObject *iter = PyObject_GetIter(self);
4647 dictview_richcompare(PyObject *self, PyObject *other, int op)
4653 assert(self != NULL);
4654 assert(PyDictViewSet_Check(self));
4660 len_self = PyObject_Size(self);
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);
4763 dictviews_to_set(PyObject *self)
4765 PyObject *left = self;
4766 if (PyDictKeys_Check(self)) {
4768 PyObject *dict = (PyObject *)((_PyDictViewObject *)self)->dv_dict;
4777 dictviews_sub(PyObject *self, PyObject *other)
4779 PyObject *result = dictviews_to_set(self);
4799 _PyDictView_Intersect(PyObject* self, PyObject *other)
4810 if (!PyDictViewSet_Check(self)) {
4812 other = self;
4813 self = tmp;
4816 len_self = dictview_len((_PyDictViewObject *)self);
4818 /* if other is a set and self is smaller than other,
4822 other, &_Py_ID(intersection), self, NULL);
4825 /* if other is another dict view, and it is bigger than self,
4831 other = self;
4832 self = tmp;
4837 1. self is a dictview
4838 2. if other is a dictview then it is smaller than self */
4849 if (PyDictKeys_Check(self)) {
4852 /* else PyDictItems_Check(self) */
4858 rv = dict_contains((_PyDictViewObject *)self, key);
4884 dictviews_or(PyObject* self, PyObject *other)
4886 PyObject *result = dictviews_to_set(self);
4899 dictitems_xor(PyObject *self, PyObject *other)
4901 assert(PyDictItems_Check(self));
4903 PyObject *d1 = (PyObject *)((_PyDictViewObject *)self)->dv_dict;
4985 dictviews_xor(PyObject* self, PyObject *other)
4987 if (PyDictItems_Check(self) && PyDictItems_Check(other)) {
4988 return dictitems_xor(self, other);
4990 PyObject *result = dictviews_to_set(self);
5026 dictviews_isdisjoint(PyObject *self, PyObject *other)
5031 if (self == other) {
5032 if (dictview_len((_PyDictViewObject *)self) == 0)
5041 Py_ssize_t len_self = dictview_len((_PyDictViewObject *)self);
5048 other = self;
5049 self = tmp;
5058 int contains = PySequence_Contains(self, item);
5540 _PyObject_VisitInstanceAttributes(PyObject *self, visitproc visit, void *arg)
5542 PyTypeObject *tp = Py_TYPE(self);
5543 assert(Py_TYPE(self)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
5544 PyDictValues **values_ptr = _PyObject_ValuesPointer(self);
5556 _PyObject_ClearInstanceAttributes(PyObject *self)
5558 PyTypeObject *tp = Py_TYPE(self);
5559 assert(Py_TYPE(self)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
5560 PyDictValues **values_ptr = _PyObject_ValuesPointer(self);
5571 _PyObject_FreeInstanceAttributes(PyObject *self)
5573 PyTypeObject *tp = Py_TYPE(self);
5574 assert(Py_TYPE(self)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
5575 PyDictValues **values_ptr = _PyObject_ValuesPointer(self);