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

Raymond Hettinger report at bugs.python.org
Mon Sep 13 17:50:34 EDT 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Just reread the thread. AFAICT not a single use case was presented for having system byte ordering as the default.  However, multiple respondents have pointed out that a default to system byte ordering is a bug waiting to happen, almost ensuring that some users will encounter unexpected behaviors when crossing platforms.  We've seen issues like that before and should avoid them.

We don't really need a poll.  What is needed is for the system byte ordering proponents to present valid reasons why it would useful and to address the concerns that it is actually harmful.

If the proposal goes through despite the concerns, we should ask folks writing lint tools to flag every use of the default as a potential bug and advise people to never use the default unless they know for sure that it is encoding only a single byte.  Personally, I would never let system byte ordering pass a code review.

----------

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


More information about the Python-bugs-list mailing list