[issue45155] Add default arguments for int.to_bytes()

Nick Coghlan report at bugs.python.org
Thu Sep 9 20:29:47 EDT 2021


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Rather than defaulting to sys.byteorder, could the byte order default to None and only be optional when not needed? (input value fits in a single byte, output is a single byte)

Otherwise the difference in defaults between this method and the struct module (network byte order rather than host byte order) could be very confusing.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45155>
_______________________________________


More information about the Python-bugs-list mailing list