Did I find the right examples for you? yes no

All Samples(1527)  |  Call(1446)  |  Derive(0)  |  Import(81)
memoryview(object)

Create a new memoryview object which references the given object.

src/s/c/scipy-lecture-notes-HEAD/advanced/advanced_numpy/examples/myobject_test.py   scipy-lecture-notes(Download)
 
obj = myobject.MyObject()
view = memoryview(obj)
 
print("shape", view.shape)

src/t/a/tables-3.1.1/examples/multiprocess_access_benchmarks.py   tables(Download)
        connection = sock.accept()[0]
        recv_buffer = bytearray(self.array_nbytes)
        view = memoryview(recv_buffer)
        bytes_recv = 0
        while bytes_recv < self.array_nbytes:

src/p/y/PyTables-HEAD/examples/multiprocess_access_benchmarks.py   PyTables(Download)
        connection = sock.accept()[0]
        recv_buffer = bytearray(self.array_nbytes)
        view = memoryview(recv_buffer)
        bytes_recv = 0
        while bytes_recv < self.array_nbytes:

src/i/r/ironpython3-HEAD/Src/StdLib/Lib/multiprocessing/connection.py   ironpython3(Download)
    def send_bytes(self, buf, offset=0, size=None):
        """Send the bytes data from a bytes-like object"""
        self._check_closed()
        self._check_writable()
        m = memoryview(buf)
        # HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
        if m.itemsize > 1:
            m = memoryview(bytes(m))
        self._check_closed()
        self._check_readable()
        with memoryview(buf) as m:
            # Get bytesize of arbitrary buffer
            itemsize = m.itemsize

src/c/p/cpython-HEAD/Lib/multiprocessing/connection.py   cpython(Download)
    def send_bytes(self, buf, offset=0, size=None):
        """Send the bytes data from a bytes-like object"""
        self._check_closed()
        self._check_writable()
        m = memoryview(buf)
        # HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
        if m.itemsize > 1:
            m = memoryview(bytes(m))
        self._check_closed()
        self._check_readable()
        with memoryview(buf) as m:
            # Get bytesize of arbitrary buffer
            itemsize = m.itemsize

src/i/r/ironpython3-HEAD/Src/StdLib/Lib/hashlib.py   ironpython3(Download)
 
        if not isinstance(password, (bytes, bytearray)):
            password = bytes(memoryview(password))
        if not isinstance(salt, (bytes, bytearray)):
            salt = bytes(memoryview(salt))

src/s/t/static-python-HEAD/Lib/multiprocessing/connection.py   static-python(Download)
    def send_bytes(self, buf, offset=0, size=None):
        """Send the bytes data from a bytes-like object"""
        self._check_closed()
        self._check_writable()
        m = memoryview(buf)
        # HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
        if m.itemsize > 1:
            m = memoryview(bytes(m))
        self._check_closed()
        self._check_readable()
        with memoryview(buf) as m:
            # Get bytesize of arbitrary buffer
            itemsize = m.itemsize

src/c/p/cpython-HEAD/Lib/hashlib.py   cpython(Download)
 
        if not isinstance(password, (bytes, bytearray)):
            password = bytes(memoryview(password))
        if not isinstance(salt, (bytes, bytearray)):
            salt = bytes(memoryview(salt))

src/i/r/ironpython3-HEAD/Src/StdLib/Lib/multiprocessing/heap.py   ironpython3(Download)
    def create_memoryview(self):
        (arena, start, stop), size = self._state
        return memoryview(arena.buffer)[start:start+size]
 

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/win32/lib/win32gui_struct.py   main(Download)
    def _make_memory(ob):
        return bytes(memoryview(ob))
 
    def _make_bytes(sval):
        return sval.encode('ascii')

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next