Home
last modified time | relevance | path

Searched refs:setitem (Results 1 – 25 of 34) sorted by relevance

12

/external/python/cpython2/Lib/test/
Dtest_memoryview.py73 def setitem(value): function
75 self.assertRaises(TypeError, setitem, b"a")
76 self.assertRaises(TypeError, setitem, 65)
77 self.assertRaises(TypeError, setitem, memoryview(b"a"))
104 def setitem(key, value): function
107 self.assertRaises(IndexError, setitem, 6, b"a")
108 self.assertRaises(IndexError, setitem, -7, b"a")
109 self.assertRaises(IndexError, setitem, sys.maxsize, b"a")
110 self.assertRaises(IndexError, setitem, -sys.maxsize, b"a")
112 self.assertRaises(TypeError, setitem, 0.0, b"a")
[all …]
Dtest_operator.py317 self.assertRaises(TypeError, operator.setitem, a)
318 self.assertRaises(TypeError, operator.setitem, a, None, None)
319 self.assertTrue(operator.setitem(a, 0, 2) is None)
321 self.assertRaises(IndexError, operator.setitem, a, 4, 2)
/external/python/cpython3/Lib/test/
Dtest_memoryview.py66 def setitem(value): function
68 self.assertRaises(TypeError, setitem, b"a")
69 self.assertRaises(TypeError, setitem, 65)
70 self.assertRaises(TypeError, setitem, memoryview(b"a"))
99 def setitem(key, value): function
102 self.assertRaises(IndexError, setitem, 6, b"a")
103 self.assertRaises(IndexError, setitem, -7, b"a")
104 self.assertRaises(IndexError, setitem, sys.maxsize, b"a")
105 self.assertRaises(IndexError, setitem, -sys.maxsize, b"a")
107 self.assertRaises(TypeError, setitem, 0.0, b"a")
[all …]
Dtest_operator.py267 self.assertRaises(TypeError, operator.setitem, a)
268 self.assertRaises(TypeError, operator.setitem, a, None, None)
269 self.assertIsNone(operator.setitem(a, 0, 2))
271 self.assertRaises(IndexError, operator.setitem, a, 4, 2)
Dtest_dbm_dumb.py219 partial(operator.setitem, f, 'b'),
/external/python/cpython3/Lib/ctypes/test/
Dtest_slicing.py49 from operator import setitem
52 self.assertRaises(TypeError, setitem, a, slice(0, 5), "abcde")
54 self.assertRaises(TypeError, setitem, a, slice(0, 5),
57 self.assertRaises(TypeError, setitem, a, slice(0, 5),
60 self.assertRaises(ValueError, setitem, a, slice(0, 5), range(32))
86 self.assertRaises(TypeError, operator.setitem,
144 self.assertRaises(TypeError, operator.setitem,
Dtest_arrays.py37 from operator import setitem
39 [setitem(ia, n, new_values[n]) for n in range(alen)]
/external/python/cpython2/Lib/ctypes/test/
Dtest_slicing.py49 from operator import setslice, setitem
53 self.assertRaises(TypeError, setitem, a, slice(0, 5), "abcde")
56 self.assertRaises(TypeError, setitem, a, slice(0, 5),
60 self.assertRaises(TypeError, setitem, a, slice(0, 5),
64 self.assertRaises(ValueError, setitem, a, slice(0, 5), range(32))
92 self.assertRaises(TypeError, operator.setitem,
152 self.assertRaises(TypeError, operator.setitem,
Dtest_arrays.py35 from operator import setitem
37 [setitem(ia, n, new_values[n]) for n in range(alen)]
/external/python/cpython3/Lib/
Doperator.py181 def setitem(a, b, c): function
450 __setitem__ = setitem
/external/python/cpython2/Doc/library/
Doperator.rst286 .. function:: setitem(a, b, c)
298 This function is removed in Python 3.x. Use :func:`setitem` with a slice
646 | Indexed Assignment | ``obj[k] = v`` | ``setitem(obj, k, v)`` |
668 | Slice Assignment | ``seq[i:j] = values`` | ``setitem(seq, slice(i, j), values)`` |
/external/python/cpython2/Modules/
Darraymodule.c28 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); member
471 if ((*self->ob_descr->setitem)(self, -1, v) < 0) in ins1()
489 return (*self->ob_descr->setitem)(self, where, v); in ins1()
789 return (*a->ob_descr->setitem)(a, i, v); in array_ass_item()
1348 if ((*self->ob_descr->setitem)(self, in array_fromlist()
1773 return (*self->ob_descr->setitem)(self, i, value); in array_ass_subscr()
DcPickle.c1809 static char setitem = SETITEM; in batch_dict() local
1834 if (self->write_func(self, &setitem, 1) < 0) in batch_dict()
1868 if (self->write_func(self, &setitem, 1) < 0) in batch_dict()
1940 static char setitem = SETITEM; in batch_dict_exact() local
1955 if (self->write_func(self, &setitem, 1) < 0) in batch_dict_exact()
Doperator.c428 spam2(setitem,__setitem__,
/external/python/setuptools/setuptools/tests/
Dtest_packageindex.py263 monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
Dtest_easy_install.py182 monkeypatch.setitem(os.environ, 'PYTHONPATH', str(target))
226 monkeypatch.setitem(os.environ, 'PYTHONPATH', str(target))
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestmagicmethods.py84 def setitem(s, name, value): function
89 mock.__setitem__ = setitem
/external/protobuf/python/
Dmox.py444 setitem = self._class_to_mock.__dict__.get('__setitem__', None)
447 if setitem is None:
/external/python/cpython3/Modules/
Darraymodule.c33 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); member
632 if ((*self->ob_descr->setitem)(self, -1, v) < 0) in ins1()
650 return (*self->ob_descr->setitem)(self, where, v); in ins1()
961 return (*a->ob_descr->setitem)(a, i, v); in array_ass_item()
1548 if ((*self->ob_descr->setitem)(self, in array_array_fromlist()
2420 return (*self->ob_descr->setitem)(self, i, value); in array_ass_subscr()
/external/python/cpython3/Doc/library/
Doperator.rst235 .. function:: setitem(a, b, c)
394 | Indexed Assignment | ``obj[k] = v`` | ``setitem(obj, k, v)`` |
416 | Slice Assignment | ``seq[i:j] = values`` | ``setitem(seq, slice(i, j), values)`` |
Dunittest.mock-examples.rst930 >>> def setitem(name, val):
935 >>> mock.__setitem__.side_effect = setitem
944 >>> mock.__setitem__ = Mock(side_effect=setitem)
952 >>> mock.__setitem__.side_effect = setitem
/external/python/mock/mock/tests/
Dtestmagicmethods.py112 def setitem(s, name, value): function
117 mock.__setitem__ = setitem
/external/fonttools/Lib/fontTools/mtiLib/
D__init__.py18 from operator import setitem
119 setReference(mapFeature, featureMap, sym, setitem, theList, i)
173 setReference(mapLookup, lookupMap, sym, setitem, theList, i)
/external/tensorflow/tensorflow/python/lib/core/
Dbfloat16.cc557 NPyBfloat16_ArrFuncs.setitem = NPyBfloat16_SetItem; in Initialize()
/external/tensorflow/tensorflow/python/training/tracking/
Ddata_structures.py839 setter=operator.setitem)])

12