[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2012-01-16 Thread Nick Coghlan
Nick Coghlan added the comment: Added 10181 as a dependency - as noted in my review comments on that issue, I think this becomes fairly trivial to fix (and test) given Stefan's other improvements. -- dependencies: +Problems with Py_buffer management in memoryobject.c (and elsewhere?)

[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou wrote: > That's rather funky. What should the right result be? Basically [5, 4, 3, 2, 1] as bytes: '\x05\x04\x03\x02\x01' Looks like an off-by-one error. I was a bit surprised that tobytes() automatically converts anything to a C-contiguous arra

[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: That's rather funky. What should the right result be? -- nosy: +pitrou ___ Python tracker ___ ___ P

[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2011-08-24 Thread Stefan Krah
New submission from Stefan Krah : memoryview.tobytes() converts a non-contiguous array to a contiguous representation. This result is not right: >>> from numpy import * >>> x = array([1,2,3,4,5], dtype="B") >>> y = x[::-1] >>> y array([5, 4, 3, 2, 1], dtype=uint8) >>> m = memoryview(y) >>> m.to