We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a74cd3b commit 5da379cCopy full SHA for 5da379c
Doc/library/stdtypes.rst
@@ -530,12 +530,14 @@ class`. In addition, it provides a few more methods:
530
is ``False``.
531
532
The default values can be used to conveniently turn an integer into a
533
- single byte object. However, when using the default arguments, don't try
534
- to convert a value greater than 255 or you'll get an :exc:`OverflowError`::
+ single byte object::
535
536
>>> (65).to_bytes()
537
b'A'
538
+ However, when using the default arguments, don't try
539
+ to convert a value greater than 255 or you'll get an :exc:`OverflowError`.
540
+
541
Equivalent to::
542
543
def to_bytes(n, length=1, byteorder='big', signed=False):
0 commit comments