diff options
author | Stefan Krah <skrah@bytereef.org> | 2019-02-02 17:57:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-02 17:57:41 (GMT) |
commit | d08ea70464cb8a1f86134dcb4a5c2eac1a02bf1a (patch) | |
tree | ea83f888c38d1b67c1c7e8ac028236a3eeb7c90d /Doc/library/stdtypes.rst | |
parent | 4860f01ac0f07cdc8fc0cc27c33f5a64e5cfec9f (diff) | |
download | cpython-d08ea70464cb8a1f86134dcb4a5c2eac1a02bf1a.zip cpython-d08ea70464cb8a1f86134dcb4a5c2eac1a02bf1a.tar.gz cpython-d08ea70464cb8a1f86134dcb4a5c2eac1a02bf1a.tar.bz2 |
bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730)
Diffstat (limited to 'Doc/library/stdtypes.rst')
-rw-r--r-- | Doc/library/stdtypes.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 8874978..d1b1b8c6 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -3600,7 +3600,7 @@ copying. Previous versions compared the raw memory disregarding the item format and the logical array structure. - .. method:: tobytes() + .. method:: tobytes(order=None) Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. :: @@ -3616,6 +3616,13 @@ copying. supports all format strings, including those that are not in :mod:`struct` module syntax. + .. versionadded:: 3.8 + *Order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data + of the original array is converted to C or Fortran order. For contiguous + views, 'A' returns an exact copy of the physical memory. In particular, + in-memory Fortran order is preserved. For non-contiguous views, the + data is converted to C first. *order=None* is the same as *order='C'*. + .. method:: hex() Return a string object containing two hexadecimal digits for each |