This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, brandtbucher, ethan.furman, mark.dickinson, mrabarnett, ncoghlan, petr.viktorin, rhettinger, serhiy.storchaka, veky, vstinner
Date 2021-09-14.05:08:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
On Sep 13, 2021, at 13:38, STINNER Victor <> wrote:
> It seems like your proposal is mostly guided by: convert an int to a byte (bytes string of length 1). IMO this case is special enough to justify the usage of a different function.

Like bchr() ? <wink>

> What if people expect int.to_bytes() always return a single byte, but then get two bytes by mistake?
> ch = 256
> byte = ch.to_bytes()

The OverflowError you’ll get seems reasonable.
Date User Action Args
2021-09-14 05:08:53barrysetrecipients: + barry, rhettinger, mark.dickinson, ncoghlan, vstinner, mrabarnett, petr.viktorin, ethan.furman, serhiy.storchaka, veky, brandtbucher
2021-09-14 05:08:53barrylinkissue45155 messages
2021-09-14 05:08:52barrycreate