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

Serhiy Storchaka report at bugs.python.org
Sun Sep 12 04:38:59 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In the stdlib, there is only one use of to_bytes() with sys.byteorder (2 in tests), 16 uses of to_bytes()/from_bytes() with 'little' (22 in tests) and 22 uses with 'big' (33 in tests). So making sys.byteorder the default will help almost nobody, and the advantage of 'big' over 'litte' is so small, that making any of them the default may only help in a half of cases and confuse in the other half.

----------

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


More information about the Python-bugs-list mailing list