This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Arfrever, belopolsky, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, skrah, vstinner
Date 2012-08-30.00:26:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346286363.03.0.00216010554927.issue15814@psf.upfronthosting.co.za>
In-reply-to
Content
My perspective is that hashing a memoryview only makes sense when the memoryview is read-only and "m == m.tobytes()" (i.e. it's a C contiguous 1D view of bytes, either because that's what the original object exported as a buffer or because the view has been cast that way)

So, I think we should document that restriction in What's New and the memoryview docs for 3.3.0, and actually enforce it in 3.3.1 by raising ValueError from hash(m) when the assumption of a 1D C contiguous bytes view is violated (the "read-only" restriction is already enforced).

In previous versions, this constraint didn't need to be explicitly enforced, since memoryview basically treated *everything* as a 1D C contiguous view of bytes.
History
Date User Action Args
2012-08-30 00:26:03ncoghlansetrecipients: + ncoghlan, loewis, georg.brandl, mark.dickinson, belopolsky, pitrou, vstinner, christian.heimes, Arfrever, skrah, meador.inge
2012-08-30 00:26:03ncoghlansetmessageid: <1346286363.03.0.00216010554927.issue15814@psf.upfronthosting.co.za>
2012-08-30 00:26:01ncoghlanlinkissue15814 messages
2012-08-30 00:26:00ncoghlancreate