gh-111140: Fix edge case in PyLong_AsNativeBytes where large negative longs may require an extra byte#116053
gh-111140: Fix edge case in PyLong_AsNativeBytes where large negative longs may require an extra byte#116053encukou merged 19 commits into
Conversation
…gative longs may require an extra byte
|
I've improved detection of the two edge cases, though for now there isn't a full solution for the positive input->MSB set output case. What I have tried though is returning a wildly different value from those cases and specifically testing for that, and it comes up just fine. So when we decide how we want to say "it's okay for positive inputs to set the MSB in the result", those TODOs can just come out and set |
Sorry, something went wrong.
|
Updated the I still need to add new tests. @encukou you are likely interested in the parameter change here |
Sorry, something went wrong.
encukou
left a comment
There was a problem hiding this comment.
The feature looks good to me. (I haven't looked at the implementation yet though.)
The docs need another pass: change remaining endianness args, ensure all the text is in sync, consider making it clearer that -1 isn't a combinable “flag”.
Sorry, something went wrong.
|
I updated the failing fuzz test output to look more like this: In verbose mode: Thoughts? I don't think making it a subTest is helpful, since there's no reasonable way to request the test run with a particular value, or to efficiently request a value be skipped. |
Sorry, something went wrong.
encukou
left a comment
There was a problem hiding this comment.
Thank you! This looks great; I did find a few nitpicks.
Sorry, something went wrong.
|
Thank you! |
Sorry, something went wrong.
…just *endianness* (pythonGH-116053)
edited by bedevere-app
Bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.