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

Barry A. Warsaw report at bugs.python.org
Fri Sep 10 12:37:09 EDT 2021


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

Petr Viktorin <encukou at gmail.com> added the comment:
> 
> Exactly, a platform-dependent default is a bad idea. A default allows using the function without the code author & reviewer even being *aware* that there is a choice, and that is dangerous.

I’m not convinced.  I’m more concerned with the obscurity of the API.  If I saw its use in some code I was reviewing, I’d look it up, and then I’d know exactly what it was doing.

----------

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


More information about the Python-bugs-list mailing list