[issue41226] Supporting `strides` in `memoryview.cast`

2022-01-13 Thread jakirkham
jakirkham added the comment: The 2nd argument is the `strides`. IOW it is just specifying how to traverse the buffer in memory to visit each of the dimensions. For the first example where `strides` is not specified, Python makes them C-ordered. IOW `m2.strides` would be `(3, 1)`.

[issue41226] Supporting `strides` in `memoryview.cast`

2021-09-30 Thread Vedran Čačić
Vedran Čačić added the comment: I surely don't understand what the third argument means. What's (1, 2) there, and what stride does it produce? -- nosy: +veky ___ Python tracker

[issue41226] Supporting `strides` in `memoryview.cast`

2021-09-29 Thread jakirkham
Change by jakirkham : -- components: +Library (Lib) type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41226] Supporting `strides` in `memoryview.cast`

2021-09-27 Thread jakirkham
Change by jakirkham : -- versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41226] Supporting `strides` in `memoryview.cast`

2020-07-06 Thread jakirkham
New submission from jakirkham : Currently one can reshape a `memoryview` using `.cast(...)` like so... ``` In [1]: m = memoryview(b"abcdef") In [2]: m2 = m.cast("B", (2, 3)) ``` However it is not currently possible to specify the `strides` when reshaping the `memoryview`. This would be