Home
last modified time | relevance | path

Searched refs:memoryview (Results 1 – 25 of 31) sorted by relevance

12

/external/python/cpython2/Lib/ctypes/test/
Dtest_strings.py29 def test_c_buffer_value(self, memoryview=memoryview): argument
35 self.assertRaises(TypeError, setattr, buf, "value", memoryview("Hello, World"))
36 self.assertRaises(TypeError, setattr, buf, "value", memoryview("abc"))
37 self.assertRaises(ValueError, setattr, buf, "raw", memoryview("x" * 100))
39 def test_c_buffer_raw(self, memoryview=memoryview): argument
42 buf.raw = memoryview("Hello, World")
44 self.assertRaises(TypeError, setattr, buf, "value", memoryview("abc"))
45 self.assertRaises(ValueError, setattr, buf, "raw", memoryview("x" * 100))
Dtest_pickling.py31 self.assertEqual(memoryview(src).tobytes(),
32 memoryview(dst).tobytes())
49 self.assertEqual(memoryview(y).tobytes(),
50 memoryview(x).tobytes())
Dtest_pep3118.py25 v = memoryview(ob)
52 v = memoryview(ob)
Dtest_array_in_pointer.py9 h = hexlify(memoryview(obj))
Dtest_byteswap.py7 return hexlify(memoryview(s)).upper()
/external/python/cpython2/Lib/test/
Dtest_memoryview.py76 self.assertRaises(TypeError, setitem, memoryview(b"a"))
282 return memoryview(obj)
291 m = memoryview(obj)
299 m = memoryview(tp(self._source))
308 m = memoryview(obj)
323 self.assertTrue(memoryview(ob))
324 self.assertTrue(memoryview(object=ob))
325 self.assertRaises(TypeError, memoryview)
326 self.assertRaises(TypeError, memoryview, ob, ob)
327 self.assertRaises(TypeError, memoryview, argument=ob)
[all …]
Dtest_getargs2.py528 self.assertRaises(TypeError, getargs_c, memoryview('a'))
539 self.assertRaises(TypeError, getargs_w, memoryview('bytes'), 3)
541 memoryview(bytearray('bytes')), 3)
553 self.assertRaises(TypeError, getargs_w_hash, memoryview('bytes'))
555 memoryview(bytearray('bytes')))
567 self.assertRaises(TypeError, getargs_w_star, memoryview('bytes'))
572 self.assertEqual(getargs_w_star(memoryview(buf)), '[emoryvie]')
589 self.assertRaises(TypeError, getargs_s, memoryview('memoryview'))
601 self.assertEqual(getargs_s_star(memoryview('abc\xe9')), 'abc\xe9')
615 self.assertRaises(TypeError, getargs_s_hash, memoryview('memoryview'))
[all …]
Dtest_buffer.py32 m = memoryview(b) # Should not raise an exception
Dtest_struct.py470 self.test_pack_into(cls=lambda b: memoryview(bytearray(b)),
471 tobytes=memoryview.tobytes)
510 data1 = memoryview('\x12\x34\x56\x78')
514 self.test_unpack_from(cls=memoryview)
Dtest_bytes.py376 self.assertEqual(self.type2test(b'abc').strip(memoryview(b'ac')), b'b')
377 self.assertEqual(self.type2test(b'abc').lstrip(memoryview(b'ac')), b'bc')
378 self.assertEqual(self.type2test(b'abc').rstrip(memoryview(b'ac')), b'ab')
576 b[:3] = memoryview(b'foo')
809 v = memoryview(b)
906 buf = memoryview(sample)
951 self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b'])
954 self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
Dtest_gzip.py34 b_data = memoryview(data).tobytes()
76 self.write_and_read_back(memoryview(data1 * 50))
Dtest_StringIO.py213 constructor = memoryview
Dtest_winreg.py337 SetValueEx(ck, "test_name", None, REG_BINARY, memoryview('val'))
Dtest_binascii.py305 type2test = memoryview
Dtest_socket.py1256 return [e.tobytes() if isinstance(e, memoryview) else e for e in self.sent]
1643 nbytes = self.cli_conn.recv_into(memoryview(buf))
1673 nbytes, addr = self.cli_conn.recvfrom_into(memoryview(buf))
/external/flatbuffers/python/flatbuffers/
Dcompat.py30 memoryview_type = memoryview
43 memoryview_type = memoryview
/external/python/cpython2/Doc/c-api/
Dbuffer.rst26 where :class:`memoryview` objects can be constructed from arrays, too.
40 :class:`memoryview`.
43 :class:`memoryview` object has been backported to Python 2.7. It is strongly
300 A :class:`memoryview` object exposes the new C level buffer interface as a
305 Create a memoryview object from an object that defines the new buffer
311 Create a memoryview object wrapping the given buffer-info structure *view*.
312 The memoryview object then owns the buffer, which means you shouldn't
314 memoryview object.
319 Create a memoryview object to a contiguous chunk of memory (in either
321 interface. If memory is contiguous, the memoryview object points to the
[all …]
/external/chromium-trace/catapult/third_party/pyserial/serial/
Dserialutil.py55 memoryview
59 class memoryview: class
71 elif isinstance(seq, memoryview):
/external/python/cpython2/Doc/library/
Dio.rst229 also be :class:`bytearray` or :class:`memoryview` of arrays of bytes.
235 Implementations should support :class:`memoryview` arguments.
393 array of bytes, either :class:`bytearray` or :class:`memoryview`.
402 :class:`memoryview`. The return value can be less than
481 either :class:`bytearray` or :class:`memoryview`.
495 or :class:`memoryview`. Depending on the actual
634 :class:`bytes`, :class:`bytearray`, or :class:`memoryview`.
Dstdtypes.rst2717 memoryview type
2722 :class:`memoryview` objects allow Python code to access the internal data
2726 .. class:: memoryview(obj)
2728 Create a :class:`memoryview` that references *obj*. *obj* must support the
2732 A :class:`memoryview` has the notion of an *element*, which is the
2737 ``len(view)`` returns the total number of elements in the memoryview,
2738 *view*. The :class:`~memoryview.itemsize` attribute will give you the
2741 A :class:`memoryview` supports slicing to expose its data. Taking a single
2745 >>> v = memoryview('abcefg')
2755 If the object the memoryview is over supports changing its data, the
[all …]
D2to3.rst198 Converts :class:`buffer` to :class:`memoryview`. This fixer is optional
199 because the :class:`memoryview` API is similar but not exactly the same as
/external/python/cpython2/Misc/Vim/
Dpython.vim73 syn keyword pythonBuiltin locals long map max memoryview min next object
/external/python/cpython2/Lib/
Dsocket.py304 view = memoryview(data)
Dgzip.py237 if isinstance(data, memoryview):
/external/python/cpython2/Doc/whatsnew/
D2.7.rst185 * The :class:`memoryview` object.
610 PEP 3137: The memoryview Object
613 The :class:`memoryview` object provides a view of another object's
617 >>> m = memoryview(string.letters)
624 >>> m2 = m[0:26] # Slicing returns another memoryview
637 :class:`memoryview` objects allow modifying the underlying object if
647 >>> mb = memoryview(b)
1027 used with :class:`memoryview` instances and other similar buffer objects.
1500 the :class:`bytearray` and :class:`memoryview` objects. (Implemented by

12