Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix typo in the int.to_bytes() docs, now it shows an OverflowError
  • Loading branch information
skirpichev committed Feb 6, 2023
commit 3c3571a8bb08805e8b82e557055c4dd0eba44d85
6 changes: 4 additions & 2 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,10 @@ class`. In addition, it provides a few more methods:
single byte object. However, when using the default arguments, don't try
to convert a value greater than 255 or you'll get an :exc:`OverflowError`::

>>> (65).to_bytes()
b'A'
>>> (256).to_bytes()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: int too big to convert

Equivalent to::

Expand Down