[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

mattip report at bugs.python.org
Mon Dec 31 02:51:00 EST 2018


mattip <matti.picus at gmail.com> added the comment:

> the original decision to exclude non 'C' views was deliberate

Seems this is reflected in the code:

```
a = np.array([[0, 1, 2], [3, 4, 5]])
mv = memoryview(a.T)
mv.f_contiguous 
# True
mv.cast('i', (3, 2))
# TypeError: memoryview: casts are restricted to C-contiguous views
```

Is there any interest in revisiting that discussion? It seems the buffer protocol could allow more flexibility wrt strides and contiguous flags. Do you have a link to the discussion where this was rejected?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34778>
_______________________________________


More information about the Python-bugs-list mailing list