| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.
Documentation build overview3 files changed ± library/stdtypes.html ± whatsnew/3.16.html ± whatsnew/changelog.html |
Sorry, something went wrong.
# Conflicts: # Doc/whatsnew/3.16.rst
…3663) 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.
| Back | FazBrowse Home | New Git URL |
memoryview.cast() now accepts a keyword-only order parameter. With a multidimensional shape, order='F' returns a zero-copy Fortran-contiguous (column-major) view of a flat buffer, while order='C' (the default) keeps the current C-contiguous behavior. This mirrors the order argument of memoryview.tobytes() and makes it possible to interface with column-major libraries from pure Python without copying.
Only 'C' and 'F' are accepted; anything else raises ValueError, and non-single-character values raise TypeError. Unlike memoryview.tobytes(), None is not accepted, since the default already means 'C'.