Check assignment arr[dstidx] = arr[srcidx] works.
(srcidx, dstidx)
| 53 | |
| 54 | |
| 55 | def _check_assignment(srcidx, dstidx): |
| 56 | """Check assignment arr[dstidx] = arr[srcidx] works.""" |
| 57 | |
| 58 | arr = np.arange(np.prod(shape)).reshape(shape) |
| 59 | |
| 60 | cpy = arr.copy() |
| 61 | |
| 62 | cpy[dstidx] = arr[srcidx] |
| 63 | arr[dstidx] = arr[srcidx] |
| 64 | |
| 65 | assert_(np.all(arr == cpy), |
| 66 | 'assigning arr[%s] = arr[%s]' % (dstidx, srcidx)) |
| 67 | |
| 68 | |
| 69 | def test_overlapping_assignments(): |