Skip to content

gh-111140: Improve PyLong_AsNativeBytes API doc example & improve the test#115380

Merged
gpshead merged 9 commits intopython:mainfrom
gpshead:fixup/gh-11140
Feb 22, 2024
Merged

gh-111140: Improve PyLong_AsNativeBytes API doc example & improve the test#115380
gpshead merged 9 commits intopython:mainfrom
gpshead:fixup/gh-11140

Conversation

@gpshead
Copy link
Member

@gpshead gpshead commented Feb 12, 2024

This expands the examples to cover both realistic use cases for the API.

I noticed thing in the test that could be done better so I added those as well: We need to guarantee that all bytes of the result are overwritten and that too many are not written. Tests now pre-fills the result with data in order to ensure that. (assuming ctypes isn't undoing that behind the scenes...)


📚 Documentation preview 📚: https://cpython-previews--115380.org.readthedocs.build/

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.13 bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants