Message77248
The problem is with the `shape` member which doesn't get recalculated as
it should when instantiating a memoryview slice:
>>> a = array('i', range(10))
>>> m = memoryview(a)[2:8]
>>> a
array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> m[:] = array('i', range(6))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: cannot modify size of memoryview object
>>> len(m)
6
>>> m.shape
(10,)
An additional problem is that `shape` is a pointer to an array of
integers, and we don't know how to reallocate it. |
|
Date |
User |
Action |
Args |
2008-12-07 20:31:47 | pitrou | set | recipients:
+ pitrou |
2008-12-07 20:31:47 | pitrou | set | messageid: <1228681907.24.0.868516520055.issue4580@psf.upfronthosting.co.za> |
2008-12-07 20:31:46 | pitrou | link | issue4580 messages |
2008-12-07 20:31:45 | pitrou | create | |
|