| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -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. :: | ||
| Expand All | @@ -3616,6 +3616,10 @@ copying. | |
| supports all format strings, including those that are not in | ||
| :mod:`struct` module syntax. | ||
|
|
||
| *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. 'A' returns | ||
| the data in the existing order. The default order is 'C'. | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNeed a versionchanged tag for the new argument.
Sorry, something went wrong.
All reactions
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityRather than "existing order", I would say "physical order" (or more precisely, "'F' if the buffer is Fortran-contiguous, 'C' otherwise"?).
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYes, let's use the more precise version. 'A' does convert non-contiguous buffers to 'C', so it should be mentioned.
Sorry, something went wrong.
All reactions
|
||
|
|
||
| .. method:: hex() | ||
|
|
||
| Return a string object containing two hexadecimal digits for each | ||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add 'order' parameter to memoryview.tobytes(). |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShould you write it as order='C'?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIs that common practice? I'd assume that order='C' means that a function raises a TypeError with a None argument. I supported None because NumPy does, too.
OTOH NumPy also documents the function with order='C', but I assumed that was an oversight or a historical quirk.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAh, I didn't realize that passing None explicitly was supported.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.