[issue15814] memoryview: equality-hash invariant

Alexander Belopolsky report at bugs.python.org
Mon Sep 3 22:21:49 CEST 2012


Alexander Belopolsky added the comment:

On Mon, Sep 3, 2012 at 3:59 PM, Martin v. Löwis <report at bugs.python.org> wrote:
> if hashing was restricted
> to contiguous bytes, then the implementation would certainly be
> simplified quite a bit: currently, if it's not contiguous, it needs
> to make a separate copy and hash that.

I would be happy if this whole business of "strided" memory layouts
would go away.  I find it to be a failed attempt of
over-generalization.  It is failed because it does not cover many
important formats even in 2-d: sparse matrices, symmetrical matrices,
banded matrices, etc., etc.  (Check level 3 BLAS or NAG for a longer
list.)  It is an over-generalizarion because in practice it is often
more efficient to gather your data in contiguous memory, perform
vector calculations and then scatter the results than to operate on
scattered data to avoid copying.

I would much rather see a generalization of suboffsets that would
allow me to have views into arrays of pointers to variable width
arrays than strides.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15814>
_______________________________________


More information about the Python-bugs-list mailing list