Christian Heimes added the comment:

memory_hash has to convert buffers unless the buffer is a single-dimensional, 
C-style and contiguous buffer. A NumPy matrix has more than one dimension, so 
it must be converted.

https://hg.python.org/cpython/file/tip/Objects/memoryobject.c#l2854

        if (!MV_C_CONTIGUOUS(self->flags)) {
            mem = PyMem_Malloc(view->len);
            if (mem == NULL) {
                PyErr_NoMemory();
                return -1;
            }
            if (buffer_to_contiguous(mem, view, 'C') < 0) {
                PyMem_Free(mem);
                return -1;
            }
        }

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28055>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to