]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-78959: Add order parameter to memoryview.cast() (GH-153663)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 3 Aug 2026 19:06:00 +0000 (22:06 +0300)
committerGitHub <noreply@github.com>
Mon, 3 Aug 2026 19:06:00 +0000 (22:06 +0300)
commitbd8b2fe2b2336d85017fb9195a523ab6d32c3d56
tree433b02f778b3398826e983963373b9e2098984ee
parentab8c7372fdf9997ed5562a7506bd34af9e17f8c5
gh-78959: Add order parameter to memoryview.cast() (GH-153663)

memoryview.cast() now accepts a keyword-only order parameter.  With
order='F' it returns a zero-copy Fortran-contiguous (column-major) view
of a flat buffer, mirroring the order argument of memoryview.tobytes().
Only 'C' (the default) and 'F' are accepted; the buffer is not copied.
Doc/library/stdtypes.rst
Doc/whatsnew/3.16.rst
Lib/test/test_memoryview.py
Misc/NEWS.d/next/Core_and_Builtins/2026-07-13-13-05-00.gh-issue-78959.Xy4a2B.rst [new file with mode: 0644]
Objects/clinic/memoryobject.c.h
Objects/memoryobject.c