Skip to content

Commit

Permalink
Mention int.to_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
ncoghlan committed Sep 9, 2021
1 parent a7b65eb commit 51357b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pep-0467.txt
Expand Up @@ -114,6 +114,14 @@ in conjunction with indexing operations on binary sequence types).
As a separate method, the new spelling will also work better with higher
order functions like ``map``.

These new methods intentionally do NOT offer the same level of general integer
support as the existing ``int.to_bytes`` conversion method, which allows
arbitrarily large integers to be converted to arbitarily long bytes objects. The
restriction to only accept positive integers that fit in a single byte means
that no byte order information is needed, and there is no need to handle
negative numbers. The documentation of the new methods will refer readers to
``int.to_bytes`` for use cases where handling of arbitrary integers is needed.


Addition of "getbyte" method to retrieve a single byte
------------------------------------------------------
Expand Down

0 comments on commit 51357b2

Please sign in to comment.