Skip to content
New issue

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

py/objint.c: int.from_bytes() and .to_bytes() can omit byteorder arg #9940

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jan 6, 2025

int.from_bytes() and int.to_bytes() required the byteorder argument. But in CPython that argument defaults to "big" and can be omitted. Fixed this.

I encountered this while porting CircuitMatter and the libraries it uses.

@dhalbert dhalbert requested review from tannewt and jepler January 6, 2025 17:12
jepler
jepler previously approved these changes Jan 6, 2025
Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. will you be submitting this upstream or does it need to be noted as a CIRCUITPY-CHANGE?

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the additional bread crumbs. future you will also say thanks, I imagine.

@jepler jepler merged commit 26283dc into adafruit:main Jan 7, 2025
585 checks passed
@dhalbert dhalbert deleted the from-bytes-to-bytes-omit-byteorder branch January 7, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants