[New-bugs-announce] [issue45155] Add default arguments for int.to_bytes()

Barry A. Warsaw report at bugs.python.org
Thu Sep 9 18:00:31 EDT 2021


New submission from Barry A. Warsaw <barry at python.org>:

In the PEP 467 discussion, I proposed being able to use

>>> (65).to_bytes()
b'A'

IOW, adding default arguments for the `length` and `byteorder` arguments to `int.to_bytes()`

https://mail.python.org/archives/list/python-dev@python.org/message/PUR7UCOITMMH6TZVVJA5LKRCBYS4RBMR/

It occurs to me that this is (1) useful on its own merits; (2) easy to do.  So I've done it.  Creating this bug so I can link a PR against it.

----------
components: Interpreter Core
messages: 401524
nosy: barry
priority: normal
severity: normal
stage: patch review
status: open
title: Add default arguments for int.to_bytes()
versions: Python 3.11

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


More information about the New-bugs-announce mailing list