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
bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder) #28265
Conversation
This is a nice improvement. Thanks. |
The main docs need to be updated as well: https://docs.python.org/3/library/stdtypes.html?highlight=to_bytes#int.to_bytes |
Ha! I knew you'd say that
Yep, thanks @rhettinger ... coming up! |
Also consider updating the default byteorder for int.from_bytes. The to/from round trip should be as symmetrical as possible. |
Please, for the sake of reproducible science (and other cases), don't add platform-dependent defaults. |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Misc/NEWS.d/next/Core and Builtins/2021-09-09-15-05-17.bpo-45155.JRw9TG.rst
Outdated
Show resolved
Hide resolved
When you're done making the requested changes, leave the comment: |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
I have made the requested changes; please review again. |
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
Misc/NEWS.d/next/Core and Builtins/2021-09-09-15-05-17.bpo-45155.JRw9TG.rst
Outdated
Show resolved
Hide resolved
When you're done making the requested changes, leave the comment: |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
…55.JRw9TG.rst Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Thanks for catching the ones I missed @brandtbucher |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @brandtbucher: please review the changes made to this pull request. |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(I think you need to re-run AC locally, too.) |
@warsaw: Please replace |
In the PEP 467 discussion, I proposed being able to use
IOW, adding default arguments for the
length
andbyteorder
arguments toint.to_bytes()
It occurs to me that this is (1) useful on its own merits; (2) easy to do. So I've done it.
https://bugs.python.org/issue45155