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

Barry A. Warsaw report at bugs.python.org
Tue Sep 14 01:07:09 EDT 2021


Barry A. Warsaw <barry at python.org> added the comment:

> I'd probably say "In the face of ambiguity, refuse the temptation to guess".
> 
> As there's disagreement about the 'correct' default, make it None and require either "big" or "little" if length > 1 (the default).

Jelle suggested that over in Discourse, and I’m not opposed, but it does mean that there’s no natural default for byteorder in int.from_bytes().

----------

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


More information about the Python-bugs-list mailing list